public SocketSample(int port) { mSocketListen = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); mSocketListen.Bind((EndPoint)(new IPEndPoint(IPAddress.Any, port))); mSocketListen.Listen(10); Ioctrl.OpenKeepAlive(mSocketListen, 1000, 3000); }
public void Start(string ip, int port) { if (mSocketListen == null) { mSocketListen = mSocketCreator.CreateSocketListen(ip, port); } Ioctrl.OpenKeepAlive(mSocketListen, 3000, 3000); mSocketListen.Listen(10); mNetIO.Accept(mSocketListen); }