Reputation: 1
use writeAndFlush very costly, but use write just add outboundBuffer, not to send, when the data send to channel? for example, lots of small packet use writeAndFlush will inefficient, how to choose in this scene. thanks
Upvotes: 0
Views: 753
Reputation: 23557
It really depends on the protocol etc.So there is not golden rule here. Just remember that if you not call flush it will not be transferred to the remote peer.
Upvotes: 1