Wrapped buffers are not thread safe.

This commit is contained in:
md_5 2013-09-10 21:33:44 +10:00
parent 422e97f495
commit 042f47cbb9

View File

@ -16,16 +16,15 @@ public class PingHandler extends PacketHandler
private final ServerInfo target; private final ServerInfo target;
private final Callback<ServerPing> callback; private final Callback<ServerPing> callback;
// TODO: Update this to 1.6.2 style!
private static final ByteBuf pingBuf = Unpooled.unreleasableBuffer( Unpooled.wrappedBuffer( new byte[]
{
(byte) 0xFE, (byte) 0x01
} ) );
@Override @Override
public void connected(ChannelWrapper channel) throws Exception public void connected(ChannelWrapper channel) throws Exception
{ {
channel.write( pingBuf ); // TODO: Update this to 1.6.2 style!
channel.write( Unpooled.wrappedBuffer( new byte[]
{
(byte) 0xFE, (byte) 0x01
} ) );
} }
@Override @Override