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.
Modifier and Type | Field and Description |
---|---|
private static InternalLogger |
logger |
private java.net.SocketAddress |
remoteAddress |
group
Modifier | Constructor and Description |
---|---|
|
Bootstrap() |
private |
Bootstrap(Bootstrap bootstrap) |
Modifier and Type | Method and Description |
---|---|
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. |
private ChannelFuture |
doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress) |
private static void |
doConnect0(ChannelFuture regFuture,
Channel channel,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
ChannelPromise promise) |
(package private) void |
init(Channel channel) |
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, attrs, bind, bind, bind, bind, bind, channel, channelFactory, channelFactory, group, group, handler, handler, initAndRegister, localAddress, localAddress, localAddress, localAddress, localAddress, option, options, register
private static final InternalLogger logger
private volatile java.net.SocketAddress remoteAddress
public Bootstrap()
private Bootstrap(Bootstrap bootstrap)
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)
#remoteAddress(SocketAddress)}
public Bootstrap remoteAddress(java.net.InetAddress inetHost, int inetPort)
#remoteAddress(SocketAddress)}
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.private ChannelFuture doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
#connect()}
private static void doConnect0(ChannelFuture regFuture, Channel channel, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
void init(Channel channel) throws java.lang.Exception
init
in class AbstractBootstrap<Bootstrap,Channel>
java.lang.Exception
public Bootstrap validate()
AbstractBootstrap
validate
in class 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
in class 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
in class AbstractBootstrap<Bootstrap,Channel>