/// <summary> /// Fire the Connected event if it exists. /// </summary> /// <param name="e"></param> protected virtual void OnConnected(TcpServerEventArgs e) { if (Connected != null) { try { Connected(this, e); } catch (TcpLibException ex) { // Close the connection if the application threw an exception that // is caught here by the server. e.ConnectionState.Close(); TcpLibApplicationExceptionEventArgs appErr = new TcpLibApplicationExceptionEventArgs(ex); } } }