com.hazelcast.nio
public interface Connection
TcpIpConnection
.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this connection.
|
Address |
getEndPoint()
Gets the
Address of the other side of this Connection. |
InetAddress |
getInetAddress()
Returns remote address of this Connection.
|
int |
getPort()
The remote port.
|
InetSocketAddress |
getRemoteSocketAddress()
Returns the address of the endpoint this Connection is connected to, or
null if it is unconnected. |
ConnectionType |
getType()
Returns the
ConnectionType of this Connection. |
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.
|
boolean |
write(SocketWritable packet)
Writes a SocketWritable packet to the other side.
|
boolean write(SocketWritable packet)
packet
- the packet to write.NullPointerException
- if packet is null.boolean isAlive()
long lastReadTime()
long lastWriteTime()
void close()
ConnectionType getType()
ConnectionType
of this Connection.null
is returned.boolean isClient()
InetAddress getInetAddress()
null
if the connection is not alive.InetSocketAddress getRemoteSocketAddress()
null
if it is unconnected.Address getEndPoint()
Address
of the other side of this Connection.
todo: rename to get remoteAddress?int getPort()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.