T - must by AbstractSelectableChannel and ByteChannel.public abstract class AbstractNioSender<T extends java.nio.channels.spi.AbstractSelectableChannel & java.nio.channels.ByteChannel> extends java.lang.Object implements ErrorReporter
| Modifier and Type | Field and Description |
|---|---|
static int |
INITIAL_BUFFER_SIZE
Default initial buffer size
40 x 8192. |
static java.lang.String |
PROPERTY_BUFFER_SIZE
Buffer size for transmit buffers.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNioSender(ErrorReporter errorReporter,
java.lang.String host,
int port)
|
| Modifier and Type | Method and Description |
|---|---|
protected T |
channel() |
void |
close() |
java.lang.String |
getHost() |
int |
getPort() |
protected boolean |
isConnected() |
protected abstract boolean |
isConnected(T channel) |
boolean |
isShutdown() |
void |
reportError(java.lang.String message,
java.lang.Exception e)
Report an error caused by a exception.
|
void |
setChannel(T channel) |
public static final java.lang.String PROPERTY_BUFFER_SIZE
public static final int INITIAL_BUFFER_SIZE
40 x 8192.protected AbstractNioSender(ErrorReporter errorReporter, java.lang.String host, int port) throws java.net.UnknownHostException
AbstractNioSender given ErrorReporter, host and port. Object creation
triggers hostname lookup for early failure.errorReporter - the error reporter.host - hostname.port - port number.java.net.UnknownHostException - if no IP address for the host could be found, or if a scope_id was specified for
a global IPv6 address.protected boolean isConnected()
throws java.io.IOException
java.io.IOExceptionprotected abstract boolean isConnected(T channel)
protected T channel()
public java.lang.String getHost()
public int getPort()
public void close()
public boolean isShutdown()
public void reportError(java.lang.String message,
java.lang.Exception e)
ErrorReporterreportError in interface ErrorReportermessage - the messagee - the exceptionpublic void setChannel(T channel)
Copyright © 2013-2020. All Rights Reserved.