Search in sources :

Example 1 with ThePacket

use of sonoyuncu.impl.event.ThePacket in project SonOyuncuClient by cppool.

the class NetworkManager method sendPacket.

public void sendPacket(Packet packetIn) {
    final ThePacket eventPacket = new ThePacket(packetIn, false);
    if (eventPacket.cancelled)
        return;
    if (this.isChannelOpen()) {
        this.flushOutboundQueue();
        this.dispatchPacket(eventPacket.packet, (GenericFutureListener<? extends Future<? super Void>>[]) null);
    } else {
        this.readWriteLock.writeLock().lock();
        try {
            this.outboundPacketsQueue.add(new NetworkManager.InboundHandlerTuplePacketListener(packetIn, (GenericFutureListener[]) null));
        } finally {
            this.readWriteLock.writeLock().unlock();
        }
    }
}
Also used : ThePacket(sonoyuncu.impl.event.ThePacket) ChannelFuture(io.netty.channel.ChannelFuture) Future(io.netty.util.concurrent.Future) GenericFutureListener(io.netty.util.concurrent.GenericFutureListener)

Aggregations

ChannelFuture (io.netty.channel.ChannelFuture)1 Future (io.netty.util.concurrent.Future)1 GenericFutureListener (io.netty.util.concurrent.GenericFutureListener)1 ThePacket (sonoyuncu.impl.event.ThePacket)1