天天看點

netty 常用類 5.0.0.Alpha1

5.0版本較之前有很大改動,如java檔案的包名等。

io.netty.bootstrap.serverbootstrap

服務端通道,serverchannel,的導引。

bootstrap sub-class which allows easy bootstrap of serverchannel

io.netty.channel.channelfuture

通道,channel,異步io操作的結果。

the result of an asynchronous channel i/o operation. 

io.netty.channel.channelinitializer

一個特殊的通道處理器,一旦一個channel被注冊到了它的eventloop,channelinitializer用于初始化channel。

a special channelhandler which offers an easy way to initialize a channel once it was registered to its eventloop.

open declaration io.netty.channel.channeloption

用于配置一個通道配置,channelconfig。

a channeloption allows to configure a channelconfig in a type-safe way. 

io.netty.channel.socket.socketchannel

tcp 套接字的channel。

a tcp/ip socket channel.

io.netty.channel.eventloopgroup

eventexecutorgroup的具體類。允許在時間循環中注冊選擇器。

special eventexecutorgroup which allows to register channel's that get processed for later selection during the event loop.

channelpipeline io.netty.channel.channel.pipeline()

傳回已配置設定的管道,channelpipeline。

return the assigned channelpipeline

channelpipeline io.netty.channel.channelpipeline.addlast(channelhandler... handlers)

在管道末尾插入一個通道處理器,channelhandler。

inserts a channelhandlers at the last position of this pipeline.

io.netty.channel.channelhandler

通道處理器,用于處理一個io事件或者攔截一個io操作。

handles an i/o event or intercepts an i/o operation, and forwards it to its next handler in its channelpipeline. 

io.netty.channel.channelhandleradapter

一個通道處理器,channelhandler,的實作。

skelton implementation of a channelhandler.

channelfuture io.netty.channel.channelhandlercontext.write(object msg)

通過對應的 管道,channelpipeline,寫消息。此方法不會進行沖洗,flush,是以你需要自己調用。

request to write a message via this channelhandlercontext through the channelpipeline. this method will not request to actual flush, so be sure to call flush() once you want to request to flush all pending data to the actual transport.

io.netty.buffer.unpooled

通過申請新的記憶體來建立一個新的位元組緩沖。

creates a new bytebuf by allocating new space or by wrapping or copying existing byte arrays, byte buffers and a string. 

bytebuf io.netty.buffer.unpooled.copiedbuffer(byte[] array)

傳回一個新的位元組緩沖,内容是指定的array參數。

creates a new big-endian buffer whose content is a copy of the specified array. the new buffer's readerindex and writerindex are 0 and array.length respectively.

上一篇: NettyHttpClient
下一篇: netty-tcp