16 Mayıs 2018 Çarşamba

Netty ChannelOutboundHandlers

ChannelOutboundHandler  Arayüzü
disconnect metodu
Açıklaması şöyle.
The difference is that disconnect and close are outbound which is also why these are defined in ChannelOutboundHandler while channelInactive is inbound and thus is defined in ChannelInboundHandler.

Outbound events are events that are explicit triggered via Channel.*, ChannelHandlerContext.* methods, like for example: "I want to close the Channel". The user can then intercept these and do something, like delay closing etc.

Inbound events are triggered by the transport itself (and so the EventLoop) and usually tell you that something has happened (which may be because you requested it or the remote peer did so).

The difference between disconnect and close depend on the transport itself, for example when using TCP there is no difference while when using UDP there is one.
ChunledWriterHandler Sınıfı
Şöyle yaparız.
p.addLast("client_codec", new HttpClientCodec());
p.addLast("chunker", new ChunkedWriteHandler());
p.addLast(new ClientHandler());

Hiç yorum yok:

Yorum Gönder