Interface Connection<ContextT,SocketT>

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
AsyncConnection<ContextT,SocketT>

public interface Connection<ContextT,SocketT> extends AutoCloseable
Represents a connection to the remote node.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the Connection an destroys the associated underlying socket.
    Returns the context used by this Connection.
    Obtains the context instance used to communicate with the remote node.
  • Method Details

    • context

      ContextT context()
      Returns the context used by this Connection.
      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 per Connection instance
      Returns:
      the socket instance
    • close

      void close()
      Closes the Connection an destroys the associated underlying socket.
      Specified by:
      close in interface AutoCloseable