Ejemplo n.º 1
0
 private static void SendPacket(PacketsProcessor sendBuffer, Socket s, bool direct = false)
 {
     // Begin sending the data to the remote device.
     try
     {
         if (s == null) return;
         if (direct) s.BeginSend(sendBuffer.GetSendBytes(), 0, sendBuffer.GetSendBytes().Length, 0, null, s);
         else s.BeginSend(sendBuffer.GetSendBytes(), 0, sendBuffer.GetSendBytes().Length, 0, new AsyncCallback(SendCallback), s);
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.Message, "PlayerClient - SendPacket", MessageBoxButtons.OK, MessageBoxIcon.Error);
         AppendLog("Exception in: PlayerClient - SendPacket ->" + ex.Message);
     }
 }