示例#1
0
        private void OnNewConnection(object Sck)
        {
            NewConnectionEventHandler handler = NewConnection;

            if (handler != null)
            {
                handler(this, Sck as Socket);
            }
        }
示例#2
0
        private void RaiseNewConnectionEvent(object socket_)
        {
            Socket socket = (Socket)socket_;

            //use a temporary copy to avoid the case a unsubscription after a null was checked
            NewConnectionEventHandler tempHandler = EventNewConnection;

            if (tempHandler != null)
            {
                tempHandler(this, new NewConnectionEventArgs(socket));
            }
        }