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