Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        private static void OnRemoteHostClose(ClientConnection sender)
        {
            LogHelper.ShowLog("Remote closed\t" + DateTime.Now.ToString() + "\t" +
                sender.Client.GetHashCode());

            Program.frmMainForm.delRemoveClient.Invoke(sender.Client);
        }
Esempio n. 3
0
 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);
     }
 }