All pastes #126665 Raw Edit

Someone

public text v1 · immutable
·published 2006-08-11 17:56 UTC
rendered paste body
    /* (non-Javadoc)
     * @see net.sf.l2j.gameserver.IOThread#sendMessage(net.sf.l2j.gameserver.serverpackets.ServerBasePacket)
     */
    void sendMessage(ServerBasePacket pkt)
    {
        ByteBuffer buf = ByteBuffer.allocateDirect(8192);
        buf.position(0);
        buf.order(ByteOrder.LITTLE_ENDIAN);
        pkt.write(buf);
        try
        {
            ToWrite += buf.remaining();
            IAsyncFuture writeFuture = pkt.getConnection().getAsyncChannel().write(buf);
            // When operation will be done the listener will be notify.
            writeFuture.addCompletionListener(this, new IOCP(pkt.getClient(), Write_State));
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }