public class TcpTransport extends Object implements AsynchronousTransport
| Modifier and Type | Class and Description |
|---|---|
static class |
TcpTransport.State |
| Modifier and Type | Field and Description |
|---|---|
AtomicBoolean |
autoFlush |
io.netty.bootstrap.Bootstrap |
bootstrap |
io.netty.channel.group.ChannelGroup |
channels |
AtomicInteger |
connectTimeout |
static int |
DEFAULT_PORT |
io.netty.channel.EventLoopGroup |
eventLoopGroup |
ExceptionReporter |
exceptionReporter |
static io.netty.handler.codec.LengthFieldPrepender |
frameEncoder |
InetSocketAddress |
localAddress |
org.slf4j.Logger |
logger |
static io.netty.handler.codec.protobuf.ProtobufDecoder |
pbDecoder |
static io.netty.handler.codec.protobuf.ProtobufEncoder |
pbEncoder |
AtomicLong |
reconnectDelay |
InetSocketAddress |
remoteAddress |
AtomicReference<SSLContext> |
sslContext |
TcpTransport.State |
state |
AtomicInteger |
writeBufferHigh |
AtomicInteger |
writeBufferLow |
AtomicInteger |
writeLimit |
Semaphore |
writeLimiter |
AtomicInteger |
writeTimeout |
| Constructor and Description |
|---|
TcpTransport(InetSocketAddress remoteAddress) |
TcpTransport(InetSocketAddress remoteAddress,
InetSocketAddress localAddress) |
TcpTransport(int remotePort) |
TcpTransport(String remoteHost) |
TcpTransport(String remoteHost,
int remotePort) |
TcpTransport(String remoteHost,
int remotePort,
String localHost,
int localPort) |
TcpTransport(String remoteHost,
String localHost) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
close(boolean force) |
void |
connect() |
void |
flush() |
boolean |
isConnected() |
void |
reconnect() |
IPromise<Proto.Msg> |
sendMessage(Proto.Msg msg) |
Promise<Proto.Msg> |
sendMessage(Proto.Msg msg,
Promise<Proto.Msg> promise) |
void |
setExceptionReporter(ExceptionReporter exceptionReporter) |
TcpTransport |
setWriteBufferLimit(int limit) |
io.netty.handler.ssl.SslHandler |
sslHandler() |
Transport |
transport() |
public final org.slf4j.Logger logger
public static final io.netty.handler.codec.protobuf.ProtobufDecoder pbDecoder
public static final io.netty.handler.codec.protobuf.ProtobufEncoder pbEncoder
public static final io.netty.handler.codec.LengthFieldPrepender frameEncoder
public static final int DEFAULT_PORT
public volatile TcpTransport.State state
public final io.netty.channel.EventLoopGroup eventLoopGroup
public final io.netty.channel.group.ChannelGroup channels
public volatile io.netty.bootstrap.Bootstrap bootstrap
public volatile Semaphore writeLimiter
public final AtomicBoolean autoFlush
public final AtomicInteger writeLimit
public final AtomicLong reconnectDelay
public final AtomicInteger connectTimeout
public final AtomicInteger writeTimeout
public final AtomicInteger writeBufferHigh
public final AtomicInteger writeBufferLow
public final InetSocketAddress remoteAddress
public final InetSocketAddress localAddress
public final AtomicReference<SSLContext> sslContext
public volatile ExceptionReporter exceptionReporter
public TcpTransport(InetSocketAddress remoteAddress)
public TcpTransport(InetSocketAddress remoteAddress, InetSocketAddress localAddress)
public TcpTransport(String remoteHost, int remotePort) throws IOException
IOExceptionpublic TcpTransport(String remoteHost, int remotePort, String localHost, int localPort) throws IOException
IOExceptionpublic TcpTransport(String remoteHost) throws IOException
IOExceptionpublic TcpTransport(String remoteHost, String localHost) throws IOException
IOExceptionpublic TcpTransport(int remotePort)
throws IOException
IOExceptionpublic void setExceptionReporter(ExceptionReporter exceptionReporter)
public TcpTransport setWriteBufferLimit(int limit)
public boolean isConnected()
isConnected in interface Transportpublic io.netty.handler.ssl.SslHandler sslHandler()
public void connect()
throws IOException
connect in interface TransportIOExceptionpublic void close()
close in interface Transportclose in interface AutoCloseablepublic void close(boolean force)
public void reconnect()
throws IOException
reconnect in interface TransportIOExceptionpublic void flush()
throws IOException
flush in interface TransportIOExceptionpublic IPromise<Proto.Msg> sendMessage(Proto.Msg msg)
sendMessage in interface AsynchronousTransportCopyright © 2018. All rights reserved.