Esempio n. 1
0
 void OnPR(PacketReceivedArgs e)
 {
     if (PacketReceived != null)
     {
         PacketReceived(e);
     }
 }
Esempio n. 2
0
 static void OnReceived(PacketReceivedArgs e)
 {
     if (PacketReceived != null)
     {
         PacketReceived(e);
     }
 }
Esempio n. 3
0
 private void PipeListener()
 {
     CheckIfDisposed();
     try {
         Listen = AppClient.Server.Listen;
         AppClient.ChatHistory.Add("Pipe " + this.PipeConnection.NativeHandle.ToString() + ": new pipe started");
         while (Listen)
         {
             LastAction = DateTime.Now;
             string request = PipeConnection.Read();
             LastAction = DateTime.Now;
             if (request.Trim() != "")
             {
                 PacketReceivedArgs es = new PacketReceivedArgs(PacketBuilder.Open(request), request);
                 OnPR(es);
                 AppClient.ChatHistory.Add("Pipe " + this.PipeConnection.NativeHandle.ToString() + ": request handled");
             }
             else
             {
                 PipeConnection.Write("ERROR 51 BAD REQUEST");
             }
             LastAction = DateTime.Now;
             PipeConnection.Disconnect();
             if (Listen)
             {
                 Connect();
             }
             AppClient.Server.WakeUp();
         }
     }
     catch (System.Threading.ThreadAbortException ex) { Log.Write(ex); }
     catch (System.Threading.ThreadStateException ex) { Log.Write(ex); }
     catch (Exception ex) {
         // Log exception
         Log.Write(ex);
     }
     finally {
         this.Close();
     }
 }
Esempio n. 4
0
 void pipe_PacketReceived(PacketReceivedArgs e)
 {
     OnPR(e);
 }
Esempio n. 5
0
 static void Server_PacketReceived(PacketReceivedArgs e)
 {
     OnReceived(e);
 }