به نام خدا سلام بر برنامه نویسان عزیز 😉 در این مطلب کد کار با Socket: استفاده از Blocking و Connected در #C را آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی این کد به این صورت است:
Blocking: True
new Blocking: False
Connected: False
new Blocking: False
Connected: False
کد کار با Socket: استفاده از Blocking و Connected در #C :
using System;
using System.Net;
using System.Net.Sockets;
class MainClass
{
public static void Main()
{
IPAddress ia = IPAddress.Parse("127.0.0.1");
IPEndPoint ie = new IPEndPoint(ia, 8000);
Socket test = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
using System.Net;
using System.Net.Sockets;
class MainClass
{
public static void Main()
{
IPAddress ia = IPAddress.Parse("127.0.0.1");
IPEndPoint ie = new IPEndPoint(ia, 8000);
Socket test = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);