예제 #1
0
 public void Send(string rawmsg)
 {
   IByteBuffer buf = Unpooled.Buffer();
   foreach (byte b in rawmsg)
   {
     buf.WriteByte(b);
   }
   if (_clientProtocol != null)
   {
     _clientProtocol.sendPacket(buf);
   }
   else
     channel.WriteAndFlushAsync(buf);
 }
예제 #2
0
 public void Send(SNMessage message)
 {
     if (channel != null && channel.Open)
     {
         if (_clientProtocol != null)
         {
             IByteBuffer buffer = SNParser.encode(message);
             _clientProtocol.sendPacket(buffer);
         }
         else
         {
             channel.WriteAndFlushAsync(message);
         }
     }
 }