Пример #1
0
 void SessionAccepted(object sender, SessionAcceptedEventArgs e)
 {
     e.Session.SessionId = null;
     e.Session.ObjectReceived += SessionObjectReceived;
     e.Session.ExceptionCaught += SessionExceptionCaught;
     ((SessionBase)e.Session).Closed += SessionClosed;
 }
Пример #2
0
        void AcceptorSessionAccepted(object sender, SessionAcceptedEventArgs e)
        {
            e.Session.ObjectReceived        += Session_ObjectReceived;
            e.Session.ObjectSent            += Session_ObjectSent;
            e.Session.ExceptionCaught       += Session_ExceptionCaught;
            ((SessionBase)e.Session).Closed += SessionClosed;

            BeginInvoke((Action)(() =>
            {
                tsslConnectCount.Text = e.Acceptor.AcceptedCount.ToString();
            }));

            AppendInfo(e.Session.RemoteEndPoint.ToString() + " 已连接!");
        }