public interface EndPoint
| Modifier and Type | Method and Description |
|---|---|
boolean |
blockReadable(long millisecs) |
boolean |
blockWritable(long millisecs) |
void |
close()
Close any backing stream associated with the endpoint
|
int |
fill(Buffer buffer)
Fill the buffer from the current putIndex to it's capacity from whatever
byte source is backing the buffer.
|
void |
flush()
Flush any buffered output.
|
int |
flush(Buffer buffer)
Flush the buffer from the current getIndex to it's putIndex using whatever byte
sink is backing the buffer.
|
int |
flush(Buffer header,
Buffer buffer,
Buffer trailer)
Flush the buffer from the current getIndex to it's putIndex using whatever byte
sink is backing the buffer.
|
String |
getLocalAddr() |
String |
getLocalHost() |
int |
getLocalPort() |
int |
getMaxIdleTime()
Get the max idle time in ms.
|
String |
getRemoteAddr() |
String |
getRemoteHost() |
int |
getRemotePort() |
Object |
getTransport() |
boolean |
isBlocking() |
boolean |
isInputShutdown() |
boolean |
isOpen() |
boolean |
isOutputShutdown() |
void |
setMaxIdleTime(int timeMs)
Set the max idle time.
|
void |
shutdownInput()
Shutdown any backing input stream associated with the endpoint
|
void |
shutdownOutput()
Shutdown any backing output stream associated with the endpoint
|
void shutdownOutput()
throws IOException
IOExceptionboolean isOutputShutdown()
void shutdownInput()
throws IOException
IOExceptionboolean isInputShutdown()
void close()
throws IOException
IOExceptionint fill(Buffer buffer) throws IOException
int value indicating the number of bytes
filled or -1 if EOF is reached.EofException - If input is shutdown or the endpoint is closed.IOExceptionint flush(Buffer buffer) throws IOException
buffer - The buffer to flush. This buffers getIndex is updated.EofException - If the endpoint is closed or output is shutdown.IOExceptionint flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException
header - A buffer to write before flushing this buffer. This buffers getIndex is updated.buffer - The buffer to flush. This buffers getIndex is updated.trailer - A buffer to write after flushing this buffer. This buffers getIndex is updated.IOExceptionString getLocalAddr()
EndPoint is bound, or null
if this EndPoint does not represent a network connection.String getLocalHost()
EndPoint is bound, or null
if this EndPoint does not represent a network connection.int getLocalPort()
EndPoint is listening, or 0
if this EndPoint does not represent a network connection.String getRemoteAddr()
EndPoint is connected, or null
if this EndPoint does not represent a network connection.String getRemoteHost()
EndPoint is connected, or null
if this EndPoint does not represent a network connection.int getRemotePort()
EndPoint is connected, or 0
if this EndPoint does not represent a network connection.boolean isBlocking()
boolean blockReadable(long millisecs)
throws IOException
IOExceptionboolean blockWritable(long millisecs)
throws IOException
IOExceptionboolean isOpen()
Object getTransport()
void flush()
throws IOException
EofException - If the endpoint is closed or output is shutdown.IOExceptionint getMaxIdleTime()
The max idle time is the time the endpoint can be idle before
extraordinary handling takes place. This loosely corresponds to
the Socket.getSoTimeout() for blocking connections,
but AsyncEndPoint implementations must use other mechanisms
to implement the max idle time.
void setMaxIdleTime(int timeMs)
throws IOException
timeMs - the max idle time in MS. Timeout <= 0 implies an infinite timeoutIOException - if the timeout cannot be set.Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.