Exemplo n.º 1
0
 private void m_sendToServer(RawPacket packet)
 {
     if (!dest.Connected)
     {
         return;
     }
     lock (serverSend)
     {
         try
         {
             var wtr = new DWriter(new NetworkStream(dest.Client));
             wtr.Write(packet.content.Length + PACKET_HEADER_SIZE);
             wtr.Write(packet.id);
             wtr.Write(ServerSendKey.Crypt(packet.content));
             wtr.Flush();
         }
         //Only occures when the socket is closed.
         catch (ObjectDisposedException) { }
         catch (IOException) { }
     }
 }