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 TypeMethodDescriptionvoidclose()Closes theConnectionan 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 perConnectioninstance- Returns:
- the socket instance
-
close
void close()Closes theConnectionan destroys the associated underlying socket.- Specified by:
closein interfaceAutoCloseable
-