|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hazelcast.nio.tcp.TcpIpConnection
public final class TcpIpConnection
The Tcp/Ip implementation of the Connection
.
A Connection has 2 sides:
ReadHandler
and the writing side of this connection
is the WriteHandler
.
Constructor Summary | |
---|---|
TcpIpConnection(TcpIpConnectionManager connectionManager,
IOSelector in,
IOSelector out,
int connectionId,
SocketChannelWrapper socketChannel)
|
Method Summary | |
---|---|
void |
close()
Closes this connection. |
void |
close(Throwable t)
|
boolean |
equals(Object o)
|
int |
getConnectionId()
|
TcpIpConnectionManager |
getConnectionManager()
|
Address |
getEndPoint()
Gets the Address of the other side of this Connection. |
InetAddress |
getInetAddress()
Returns remote address of this Connection. |
TcpIpConnectionMonitor |
getMonitor()
|
int |
getPort()
The remote port. |
com.hazelcast.nio.tcp.ReadHandler |
getReadHandler()
|
InetSocketAddress |
getRemoteSocketAddress()
Returns the address of the endpoint this Connection is connected to, or null if it is unconnected. |
SocketChannelWrapper |
getSocketChannelWrapper()
|
ConnectionType |
getType()
Returns the ConnectionType of this Connection. |
WriteHandler |
getWriteHandler()
|
int |
hashCode()
|
boolean |
isAlive()
Checks if the Connection is still alive. |
boolean |
isClient()
Checks if it is a client connection. |
long |
lastReadTime()
Returns the clock time of the most recent read using this connection. |
long |
lastWriteTime()
Returns the clock time of the most recent write using this connection. |
void |
setEndPoint(Address endPoint)
|
void |
setMonitor(TcpIpConnectionMonitor monitor)
|
void |
setType(ConnectionType type)
|
String |
toString()
|
boolean |
write(SocketWritable packet)
Writes a SocketWritable packet to the other side. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TcpIpConnection(TcpIpConnectionManager connectionManager, IOSelector in, IOSelector out, int connectionId, SocketChannelWrapper socketChannel)
Method Detail |
---|
public ConnectionType getType()
Connection
ConnectionType
of this Connection.
getType
in interface Connection
null
is returned.public TcpIpConnectionManager getConnectionManager()
public boolean write(SocketWritable packet)
Connection
write
in interface Connection
packet
- the packet to write.
public boolean isClient()
Connection
isClient
in interface Connection
public void setType(ConnectionType type)
public SocketChannelWrapper getSocketChannelWrapper()
public InetAddress getInetAddress()
Connection
getInetAddress
in interface Connection
null
if the connection is not alive.public int getPort()
Connection
getPort
in interface Connection
public InetSocketAddress getRemoteSocketAddress()
Connection
null
if it is unconnected.
getRemoteSocketAddress
in interface Connection
public com.hazelcast.nio.tcp.ReadHandler getReadHandler()
public WriteHandler getWriteHandler()
public boolean isAlive()
Connection
isAlive
in interface Connection
public long lastWriteTime()
Connection
lastWriteTime
in interface Connection
public long lastReadTime()
Connection
lastReadTime
in interface Connection
public Address getEndPoint()
Connection
Address
of the other side of this Connection.
todo: rename to get remoteAddress?
getEndPoint
in interface Connection
public void setEndPoint(Address endPoint)
public void setMonitor(TcpIpConnectionMonitor monitor)
public TcpIpConnectionMonitor getMonitor()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void close()
Connection
close
in interface Connection
public void close(Throwable t)
public int getConnectionId()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |