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)); }
public void Write(Session session, Msg msg) { Acceptor.Trigger(new SendEvent(session, msg)); }
public void DoClose(Session session) { Acceptor.Trigger(new BrokenEvent(Acceptor, session)); }