/// <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); } } }
private void OnRemoteConnected(object sender, TcpServerEventArgs e) { _client = e.ConnectionState.Connection; log.DebugFormat("Client from {0} connected.", _client.RemoteEndPoint.ToString()); }