is a clientsocketchannelfactory implementation, based on the Socketchannel blocking mode of the client channel. The use of the traditional blocking IO API is characterized by good throughput and low latency, when the number of connections required for the service is small. (Contact the difference between NiO and OIO)
There is only one thread type in oioclientsocketchannelfactory, worker threads. Each connected channel has a dedicated worker, which is the traditional IO model . (see)
when Oioclientsocketchannelfactory is constructed, the parameter thread pool object, such as Executors.newcachedthreadpool (), is the source of the worker threads. So make sure that the specified executor can provide a sufficient number of threads. The worker thread is deferred (acquired lazily) and is freed when there is no transaction to process, and all Yu's thread-related resources are freed, so gracefully shut down the service (close all channel first, call Channelgroup.close (), and then call Releaseexternalresources () to release the external resource).
be careful not to shut down the executor before all the channels are closed, otherwise rejectedexecutionexception will occur, and some related resources will not be released normally.
restriction : Socketchannel created by Oioclientsocketchannelfactory does not support asynchronous operations, and any IO operations, such as connections, writes, etc. are blocked by execution.
Netty3 Source Analysis-Oioclientsocketchannelfactory