public final class TransportConnector extends Object
TransportConnector
is a helper class that creates, initializes and registers the channel.
It performs the actual connect operation to the remote peer or binds the channel.Constructor and Description |
---|
TransportConnector() |
Modifier and Type | Method and Description |
---|---|
static Mono<Channel> |
bind(TransportConfig config,
ChannelInitializer<Channel> channelInitializer,
SocketAddress bindAddress,
boolean isDomainSocket)
Binds a
Channel . |
static Mono<Channel> |
connect(TransportConfig config,
SocketAddress remoteAddress,
AddressResolverGroup<?> resolverGroup,
ChannelInitializer<Channel> channelInitializer)
Connect a
Channel to the remote peer. |
static void |
setAttributes(Channel channel,
Map<AttributeKey<?>,?> attrs)
Set the channel attributes
|
static void |
setChannelOptions(Channel channel,
Map<ChannelOption<?>,?> options,
boolean isDomainSocket)
Set the channel options
|
public static Mono<Channel> bind(TransportConfig config, ChannelInitializer<Channel> channelInitializer, SocketAddress bindAddress, boolean isDomainSocket)
Channel
.config
- the transport configurationchannelInitializer
- the ChannelInitializer
that will be used for initializing the channel pipelinebindAddress
- the local addressMono
of Channel
public static Mono<Channel> connect(TransportConfig config, SocketAddress remoteAddress, AddressResolverGroup<?> resolverGroup, ChannelInitializer<Channel> channelInitializer)
Channel
to the remote peer.config
- the transport configurationremoteAddress
- the SocketAddress
to connect toresolverGroup
- the resolver which will resolve the address of the unresolved named addresschannelInitializer
- the ChannelInitializer
that will be used for initializing the channel pipelineMono
of Channel
public static void setAttributes(Channel channel, Map<AttributeKey<?>,?> attrs)
channel
- the channelattrs
- the attributespublic static void setChannelOptions(Channel channel, Map<ChannelOption<?>,?> options, boolean isDomainSocket)
channel
- the channeloptions
- the options