netty - Difference between calling close() directly and using ChannelFutureListener.CLOSE -


i'm using netty 3.6.6.

could explain difference between following 2 codes?

  1. channel.close();

  2. channel.write(channelbuffers.empty_buffer).addlistener(channelfuturelistener.close);

when used no 1, found netty sent tcp fin before sending packets wrote. consequently, client couldn't packets server sent. couldn't find problem no 2.

i don't understand why no 1 makes problem. what's difference?

thanks in advance.

i new netty, here option: 1.will directly close channel no matter whether or not have unsend packets. 2.will add listener channelfuture detect if packets sented , close channel


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -