public class NettyTcpClientFactory extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
io.netty.channel.ChannelFuture |
createClient(SocketAddress remoteAddress) |
io.netty.channel.ChannelFuture |
createClient(String host,
int port) |
static NettyTcpClientFactory |
getInstance()
复用一个公共实例
注意,绑定到该工厂的SocketChannelHandler,也只能是一个。
|
static void |
main(String[] args) |
static NettyTcpClientFactory |
newInstance()
建立多个工厂,使用者自己来管理实例
此时每个客户端连接,各自绑定独立的handler
|
public static NettyTcpClientFactory getInstance()
public static NettyTcpClientFactory newInstance()
public static void main(String[] args)
public io.netty.channel.ChannelFuture createClient(SocketAddress remoteAddress)
public io.netty.channel.ChannelFuture createClient(String host, int port)
Copyright © 2024. All rights reserved.