egg
egg

Reputation: 1

how to choose write vs writeandflush in using netty 4

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

Answers (1)

Norman Maurer
Norman Maurer

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

Related Questions