コード例 #1
0
 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);
 }
コード例 #2
0
        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);
        }