Address

public interface Address
Author:Lars Kroll <lkroll@kth.se>

Methods

asSocket

public InetSocketAddress asSocket()

Get this address as InetSocketAddress. This is used for lookups within network implementation, so it better be fast. Preferably no new object creation should happen as part of this call.

Returns:ip+port of this address.

getIp

public InetAddress getIp()
Returns:the IP address part of this object

getPort

public int getPort()
Returns:the port part of this object

sameHostAs

public boolean sameHostAs(Address other)

Compares only the ip+port part of the address for equality. This is used to decide whether or not to reflect messages back up without serialising. Most likely the same as “this.asSocket().equals(other.asSocket())”.

Parameters:
  • other