Exemplo n.º 1
0
 public void ExceptionCaught(Session session, Exception e)
 {
     if (e is ArgumentNullException)
     {
         logReport.OnWarningReport("ArgumentNullException,case by" + e.Message);
     }
     else if (e is ArgumentException)
     {
         logReport.OnWarningReport("ArgumentException," + e.Message);
     }
     else if (e is ObjectDisposedException)
     {
         logReport.OnWarningReport("socket closed,ObjectDisposedException," + e.Message);
     }
     else if (e is SocketException)
     {
         logReport.OnWarningReport("SocketException,errcode:" + ((SocketException)e).ErrorCode);
     }
     else
     {
         logReport.OnWarningReport("Exception,case by" + e.Message);
     }
     Acceptor.Trigger(new BrokenEvent(Acceptor, session));
 }
Exemplo n.º 2
0
 public void Write(Session session, Msg msg)
 {
     Acceptor.Trigger(new SendEvent(session, msg));
 }
Exemplo n.º 3
0
 public void DoClose(Session session)
 {
     Acceptor.Trigger(new BrokenEvent(Acceptor, session));
 }