| | |
| | | } |
| | | |
| | | @Override |
| | | public void sendMsg(String msg) { |
| | | public void sendMsg(byte[] msg) { |
| | | this.sendMsg(msg,true); |
| | | } |
| | | |
| | |
| | | * @param isJoinTimeoutManager 是否加入超时管理器 |
| | | */ |
| | | @Override |
| | | public void sendMsg(String msg, boolean isJoinTimeoutManager) { |
| | | public void sendMsg(byte[] msg, boolean isJoinTimeoutManager) { |
| | | if (msg==null ){ |
| | | return; |
| | | } |
| | |
| | | } |
| | | try { |
| | | ByteBuf byteBuf = ByteBufAllocator.DEFAULT.ioBuffer(); |
| | | byteBuf.writeBytes(msg.getBytes()); |
| | | byteBuf.writeBytes(msg); |
| | | channel.writeAndFlush(byteBuf); |
| | | } catch (Exception e) { |
| | | Log.i(TAG, "发送消息失败,reason="+e.getMessage()+"\t"+msg); |