public static void HandleReceive(TcpClient client) { LogHelper.ShowLog("Receive connect\t" + DateTime.Now.ToString() + "\t" + client.GetHashCode().ToString()); Program.frmMainForm.delAddClient.Invoke(client); ClientConnection objClientConnection = new ClientConnection(client); objClientConnection.OnMessageReceived += new MessageReceive(OnReceive); objClientConnection.OnRemoteHostClosed += new RemoteHostClose(OnRemoteHostClose); }
private static void OnRemoteHostClose(ClientConnection sender) { LogHelper.ShowLog("Remote closed\t" + DateTime.Now.ToString() + "\t" + sender.Client.GetHashCode()); Program.frmMainForm.delRemoveClient.Invoke(sender.Client); }
private static void OnReceive(ClientConnection sender, string data) { try { LogHelper.ShowLog("Receive\t\t" + DateTime.Now.ToString() + "\t" + sender.Client.GetHashCode().ToString() + "\t" + data); } catch (Exception ex) { ExceptionHelper.ShowException(ex); } }