コード例 #1
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);
         }
     }
 }
コード例 #2
0
        protected override void Encode(IChannelHandlerContext context, SNMessage message, List <object> output)
        {
            IByteBuffer buffer = SNParser.encode(message);

            output.Add(new DatagramPacket(buffer, _channel.LocalAddress, _channel.RemoteAddress));
        }