Java Code Examples for io.netty.channel.ChannelHandlerContext.disconnect()

The following are Jave code examples for showing how to use disconnect() of the io.netty.channel.ChannelHandlerContext class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: CustomWorldGen   File: NetworkDispatcher.java   View Source Code Vote up 5 votes
@Override
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
{
    if (side == Side.CLIENT)
    {
        MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager));
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager));
    }
    cleanAttributes(ctx);
    ctx.disconnect(promise);
}
 
Example 2
Project: aws-sdk-java-v2   File: LoggingHandler.java   View Source Code Vote up 4 votes
@Override
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) {
    log(() -> format(ctx, "DISCONNECT"));
    ctx.disconnect(promise);
}
 
Example 3
Project: FFS-PubSub   File: ClientHandler.java   View Source Code Vote up 4 votes
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
	if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state() == IdleState.ALL_IDLE) ctx.disconnect();
	super.userEventTriggered(ctx, evt);
}