Пример #1
0
        protected void OnProceedingFinished(ResponceEventArgs e)
        {
            EventHandler proceedingFinished = ProceedingFinished;

            if (proceedingFinished != null)
            {
                proceedingFinished(this, e);
            }
        }
 public static void SendResponce(ResponceEventArgs e)
 {
     try
     {
         Socket   client       = e.Node.Client.Socket;
         Responce resp         = e.Responce;
         String   jsonResponce = Serializator.Serialize(resp);
         byte[]   toSend       = Encoding.Unicode.GetBytes(jsonResponce);
         client.BeginSend(toSend, 0, toSend.Length, SocketFlags.None, SendCallback, e.Node.Client);
     }
     catch (SocketException exc)
     {
         Console.WriteLine("Socket exception: " + exc.SocketErrorCode);
     }
     catch (Exception exc)
     {
         Console.WriteLine("Exception: " + exc);
     }
 }