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); } } }
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)); }