Ejemplo n.º 1
0
        /// <summary>
        /// Implements the connect method to process connected connetion.
        /// </summary>
        internal override void processClientConnect(SocketAsyncEventArgs e)
        {
            try {
                if (e.SocketError != SocketError.Success)
                {
                    // invoke the client handler to process the error in the implementation
                    ClientHandler?.ConnectionError(this, e);
                    return;
                }

                // invoke the client handler to process the event in the implementation
                ClientHandler?.ConnectionOpened(this);
            } finally {
                // signal the waiter
                ConnectTaskCompleteSignal.Set();
            }
        }