コード例 #1
0
ファイル: Website.cs プロジェクト: jabbo/Jabbo
 private static void connectionRequest(IAsyncResult iAr)
 {
     Socket newSocket = ((Socket)iAr.AsyncState).EndAccept(iAr);
     if (newSocket.RemoteEndPoint.ToString().Split(':')[0] != _musHost)
     {
         newSocket.Close();
         socketHandler.BeginAccept(new AsyncCallback(connectionRequest), socketHandler);
         return;
     }
     WebsiteConnection newConnection = new WebsiteConnection(newSocket);
     socketHandler.BeginAccept(new AsyncCallback(connectionRequest), socketHandler);
 }
コード例 #2
0
        private static void connectionRequest(IAsyncResult iAr)
        {
            Socket newSocket = ((Socket)iAr.AsyncState).EndAccept(iAr);

            if (newSocket.RemoteEndPoint.ToString().Split(':')[0] != _musHost)
            {
                newSocket.Close();
                socketHandler.BeginAccept(new AsyncCallback(connectionRequest), socketHandler);
                return;
            }
            WebsiteConnection newConnection = new WebsiteConnection(newSocket);

            socketHandler.BeginAccept(new AsyncCallback(connectionRequest), socketHandler);
        }