public class Bootstrap extends AbstractBootstrap<Bootstrap,Channel>
Bootstrap
that makes it easy to bootstrap a Channel
to use
for clients.
The AbstractBootstrap.bind()
methods are useful in combination with connectionless transports such as datagram (UDP).
For regular TCP connections, please use the provided connect()
methods.
构造器和说明 |
---|
Bootstrap() |
限定符和类型 | 方法和说明 |
---|---|
Bootstrap |
clone()
Returns a deep clone of this bootstrap which has the identical configuration.
|
Bootstrap |
clone(EventLoopGroup group)
Returns a deep clone of this bootstrap which has the identical configuration except that it uses
the given
EventLoopGroup . |
ChannelFuture |
connect()
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(java.net.InetAddress inetHost,
int inetPort)
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(java.net.SocketAddress remoteAddress)
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(java.lang.String inetHost,
int inetPort)
Connect a
Channel to the remote peer. |
Bootstrap |
remoteAddress(java.net.InetAddress inetHost,
int inetPort) |
Bootstrap |
remoteAddress(java.net.SocketAddress remoteAddress)
The
SocketAddress to connect to once the connect() method
is called. |
Bootstrap |
remoteAddress(java.lang.String inetHost,
int inetPort) |
java.lang.String |
toString() |
Bootstrap |
validate()
Validate all the parameters.
|
attr, bind, bind, bind, bind, bind, channel, channelFactory, group, group, handler, localAddress, localAddress, localAddress, localAddress, option, register
public Bootstrap remoteAddress(java.net.SocketAddress remoteAddress)
SocketAddress
to connect to once the connect()
method
is called.public Bootstrap remoteAddress(java.lang.String inetHost, int inetPort)
public Bootstrap remoteAddress(java.net.InetAddress inetHost, int inetPort)
public ChannelFuture connect()
Channel
to the remote peer.public ChannelFuture connect(java.lang.String inetHost, int inetPort)
Channel
to the remote peer.public ChannelFuture connect(java.net.InetAddress inetHost, int inetPort)
Channel
to the remote peer.public ChannelFuture connect(java.net.SocketAddress remoteAddress)
Channel
to the remote peer.public ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Channel
to the remote peer.public Bootstrap validate()
AbstractBootstrap
validate
在类中 AbstractBootstrap<Bootstrap,Channel>
public Bootstrap clone()
AbstractBootstrap
Channel
s with similar settings. Please note that this method does not clone the
EventLoopGroup
deeply but shallowly, making the group a shared resource.clone
在类中 AbstractBootstrap<Bootstrap,Channel>
public Bootstrap clone(EventLoopGroup group)
EventLoopGroup
. This method is useful when making multiple Channel
s with similar
settings.public java.lang.String toString()
toString
在类中 AbstractBootstrap<Bootstrap,Channel>