public final 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.
| Constructor and Description |
|---|
Bootstrap() |
| Modifier and Type | Method and Description |
|---|---|
Bootstrap |
channel(Class<? extends Channel> channelClass)
|
Bootstrap |
channelFactory(ChannelFactory<? extends Channel> channelFactory)
ServerChannelFactory which is used to create ServerChannel instances when calling
AbstractBootstrap.bind(). |
Bootstrap |
clone()
Returns a deep clone of this bootstrap which has the identical configuration.
|
ChannelFuture |
connect()
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(InetAddress inetHost,
int inetPort)
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(SocketAddress remoteAddress)
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connect a
Channel to the remote peer. |
ChannelFuture |
connect(String inetHost,
int inetPort)
Connect a
Channel to the remote peer. |
Bootstrap |
remoteAddress(InetAddress inetHost,
int inetPort) |
Bootstrap |
remoteAddress(SocketAddress remoteAddress)
The
SocketAddress to connect to once the connect() method
is called. |
Bootstrap |
remoteAddress(String inetHost,
int inetPort) |
String |
toString() |
Bootstrap |
validate()
Validate all the parameters.
|
attr, bind, bind, bind, bind, bind, group, group, handler, localAddress, localAddress, localAddress, localAddress, option, registerpublic Bootstrap channel(Class<? extends Channel> channelClass)
Class which is used to create Channel instances from.
You either use this or channelFactory(ChannelFactory) if your
Channel implementation has no no-args constructor.public Bootstrap channelFactory(ChannelFactory<? extends Channel> channelFactory)
ServerChannelFactory which is used to create ServerChannel instances when calling
AbstractBootstrap.bind(). This method is usually only used if channel(Class) is not working for you because of
some more complex needs. If your Channel implementation has a no-args constructor, its highly recommend
to just use channel(Class) for simplify your code.public Bootstrap remoteAddress(SocketAddress remoteAddress)
SocketAddress to connect to once the connect() method
is called.public Bootstrap remoteAddress(String inetHost, int inetPort)
#remoteAddress(SocketAddress)}public Bootstrap remoteAddress(InetAddress inetHost, int inetPort)
#remoteAddress(SocketAddress)}public ChannelFuture connect()
Channel to the remote peer.public ChannelFuture connect(String inetHost, int inetPort)
Channel to the remote peer.public ChannelFuture connect(InetAddress inetHost, int inetPort)
Channel to the remote peer.public ChannelFuture connect(SocketAddress remoteAddress)
Channel to the remote peer.public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
Channel to the remote peer.public Bootstrap validate()
AbstractBootstrapvalidate in class AbstractBootstrap<Bootstrap,Channel>public Bootstrap clone()
AbstractBootstrapChannels with similar settings. Please note that this method does not clone the
EventExecutorGroup deeply but shallowly, making the group a shared resource.clone in class AbstractBootstrap<Bootstrap,Channel>public String toString()
toString in class AbstractBootstrap<Bootstrap,Channel>Copyright © 2008–2013 The Netty Project. All rights reserved.