Example #1
0
 private void SendAsync(Socket client, byte[] messageBuffer, bool useExceptionList)
 {
     byte[] messageBytes = Buffer.AddSplitter(messageBuffer, 0);
     try
     {
         client.Send(messageBytes);
         OnServerSend?.Invoke(this, new EventArgs());
     }
     catch (Exception exception)
     {
         if (useExceptionList)
         {
             CheckException(exception);
         }
         else
         {
             OnSendException?.Invoke(this, new ExceptionEventArgs(client, exception));
         }
     }
 }