Class RemoteHostId


  • final class RemoteHostId
    extends Object
    Unique ID for a peer - its IP + port, all bundled into a tidy obj. If the remote peer is not reachable through an IP+port, this contains the hash of their identity.
    • Constructor Detail

      • RemoteHostId

        public RemoteHostId​(byte[] ip,
                            int port)
        direct
      • RemoteHostId

        public RemoteHostId​(Hash peerHash)
        indirect
    • Method Detail

      • getIP

        public byte[] getIP()
        Returns:
        null if indirect
      • getPort

        public int getPort()
        Returns:
        0 if indirect
      • getPeerHash

        public Hash getPeerHash()
        Returns:
        null if direct
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object