Module convex.peer
Package convex.net

Class AConnection

java.lang.Object
convex.net.AConnection

public abstract class AConnection extends Object
  • Constructor Details

    • AConnection

      public AConnection()
  • Method Details

    • isTrusted

      public boolean isTrusted()
    • sendMessage

      public abstract boolean sendMessage(Message msg) throws IOException
      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

      public abstract InetSocketAddress getRemoteAddress()
      Returns the remote SocketAddress associated with this connection, or null if not available
      Returns:
      An InetSocketAddress if associated, otherwise null
    • setTrustedKey

      public void setTrustedKey(AccountKey key)
      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()