java.lang.Object
convex.net.AConnection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
abstract long
abstract InetSocketAddress
Returns the remote SocketAddress associated with this connection, or null if not availableabstract boolean
isClosed()
Checks if this connection is closed (i.e. the underlying channel is closed)boolean
abstract boolean
sendMessage
(Message msg) Sends a message over this connectionvoid
setTrustedKey
(AccountKey key) Sets the trusted remote key for this connection.
-
Constructor Details
-
AConnection
public AConnection()
-
-
Method Details
-
isTrusted
public boolean isTrusted() -
sendMessage
Sends a message over this connection- Parameters:
msg
- Message to send- Returns:
- true if message buffered successfully, false if failed due to full buffer
- Throws:
IOException
- If IO error occurs while sending
-
getRemoteAddress
Returns the remote SocketAddress associated with this connection, or null if not available- Returns:
- An InetSocketAddress if associated, otherwise null
-
setTrustedKey
Sets the trusted remote key for this connection. Only do this f the other side has successfully responded to an authentication challenge- Parameters:
key
-
-
isClosed
public abstract boolean isClosed()Checks if this connection is closed (i.e. the underlying channel is closed)- Returns:
- true if the channel is closed, false otherwise.
-
close
public abstract void close() -
getReceivedCount
public abstract long getReceivedCount()
-