| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

public interface IConnection
A connection (session) between two endpoints. It encapsulates the underlying socket channel. 
| Nested Class Summary | |
|---|---|
| static class | IConnection.FlushMode | 
| Field Summary | |
|---|---|
| static boolean | DEFAULT_AUTOFLUSH | 
| static long | DEFAULT_CONNECTION_TIMEOUT_MILLIS | 
| static IConnection.FlushMode | DEFAULT_FLUSH_MODE | 
| static long | DEFAULT_IDLE_TIMEOUT_MILLIS | 
| static String | INITIAL_DEFAULT_ENCODING | 
| static long | MAX_TIMEOUT_MILLIS | 
| static String | SO_KEEPALIVE | 
| static String | SO_LINGER | 
| static String | SO_RCVBUF | 
| static String | SO_REUSEADDR | 
| static String | SO_SNDBUF | 
| static String | SO_TIMEOUT | 
| static String | TCP_NODELAY | 
| Method Summary | |
|---|---|
|  Object | getAttachment()Retrieves the current attachment. | 
|  long | getConnectionTimeoutMillis()gets the connection timeout | 
|  String | getId()returns the id | 
|  long | getIdleTimeoutMillis()returns the idle timeout in millis. | 
|  InetAddress | getLocalAddress()returns the local address | 
|  int | getLocalPort()returns the local port | 
|  Object | getOption(String name)returns the value of a option | 
|  Map<String,Class> | getOptions()Returns an unmodifiable map of the options supported by this end point. | 
|  long | getRemainingMillisToConnectionTimeout()returns the remaining time before a connection timeout occurs | 
|  long | getRemainingMillisToIdleTimeout()returns the remaining time before a idle timeout occurs | 
|  InetAddress | getRemoteAddress()returns the remote address | 
|  int | getRemotePort()returns the port of the remote end point | 
|  boolean | isOpen()returns, if the connection is open. | 
|  boolean | isServerSide()returns true id connection is server side | 
|  void | setAttachment(Object obj)Attaches the given object to this connection | 
|  void | setConnectionTimeoutMillis(long timeoutMillis)sets the max time for a connections. | 
|  void | setIdleTimeoutMillis(long timeoutInMillis)sets the idle timeout in millis | 
|  void | setOption(String name,
          Object value)sets the value of a option. | 
| Methods inherited from interface java.io.Closeable | 
|---|
| close | 
| Field Detail | 
|---|
static final String INITIAL_DEFAULT_ENCODING
static final String SO_SNDBUF
static final String SO_RCVBUF
static final String SO_REUSEADDR
static final String SO_KEEPALIVE
static final String SO_LINGER
static final String TCP_NODELAY
static final String SO_TIMEOUT
static final long MAX_TIMEOUT_MILLIS
static final long DEFAULT_CONNECTION_TIMEOUT_MILLIS
static final long DEFAULT_IDLE_TIMEOUT_MILLIS
static final IConnection.FlushMode DEFAULT_FLUSH_MODE
static final boolean DEFAULT_AUTOFLUSH
| Method Detail | 
|---|
String getId()
boolean isServerSide()
boolean isOpen()
IDataHandler.onData(INonBlockingConnection)
int getLocalPort()
InetAddress getLocalAddress()
InetAddress getRemoteAddress()
int getRemotePort()
long getIdleTimeoutMillis()
void setIdleTimeoutMillis(long timeoutInMillis)
timeoutInSec - idle timeout in millislong getConnectionTimeoutMillis()
void setConnectionTimeoutMillis(long timeoutMillis)
timeoutSec - the connection timeout in millislong getRemainingMillisToIdleTimeout()
long getRemainingMillisToConnectionTimeout()
void setOption(String name,
               Object value)
               throws IOException
http://www.onlamp.com/lpt/a/6324
name - the name of the optionvalue - the value of the option
IOException - In an I/O error occurs
Object getOption(String name)
                 throws IOException
name - the name of the option
IOException - In an I/O error occursMap<String,Class> getOptions()
void setAttachment(Object obj)
obj - The object to be attached; may be nullObject getAttachment()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||