protected virtual void OnSocketException(SocketExceptionEventArgs e) { if (SocketException != null) SocketException(this, e); }
private void HandleSocketException(object sender, SocketExceptionEventArgs e) { s_log.ErrorFormat("Socket threw exception: {0}", e.Exception.Message); // Notify the subscribers of the Disconnected event. OnDisconnected(new DisconnectedEventArgs(String.Format("{0}", e.Exception.Message))); // Clean up the socket management since there's no connected socket anymore. Disconnect(); }