Package dev.getelements.elements.rt
Interface Connection<ContextT,SocketT>
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
AsyncConnection<ContextT,
SocketT>
Represents a connection to the remote node.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes theConnection
an destroys the associated underlying socket.context()
Returns the context used by thisConnection
.socket()
Obtains the context instance used to communicate with the remote node.
-
Method Details
-
context
ContextT context()Returns the context used by thisConnection
.- Returns:
- the context instance
-
socket
SocketT socket()Obtains the context instance used to communicate with the remote node. This must always return the same instance of context perConnection
instance- Returns:
- the socket instance
-
close
void close()Closes theConnection
an destroys the associated underlying socket.- Specified by:
close
in interfaceAutoCloseable
-