Esempio n. 1
0
        private static void OnTcpConnectCompleted(object sender, SocketAsyncEventArgs args)
        {
            args.Completed -= OnTcpConnectCompleted;
            TcpUserToken token = (TcpUserToken)args.UserToken;

            AutoReleaseAsyncResult r = new AutoReleaseAsyncResult
            {
                AsyncState = token.AsyncState,
                UserToken  = token
            };

            token.Callback(r);
        }
Esempio n. 2
0
        private static void OnTcpConnectCompleted(object sender, SocketAsyncEventArgs args)
        {
            TcpUserToken token = (TcpUserToken)args.UserToken;

            token.Callback(token);
        }