Package se.sics.kompics.network
Interface Address
- All Known Implementing Classes:
TestAddress
public interface Address
- Author:
- Lars Kroll <[email protected]>
-
Method Summary
Modifier and Type Method Description InetSocketAddress
asSocket()
Get this address as InetSocketAddress.InetAddress
getIp()
int
getPort()
boolean
sameHostAs(Address other)
Compares only the ip+port part of the address for equality.
-
Method Details
-
getIp
- Returns:
- the IP address part of this object
-
getPort
int getPort()- Returns:
- the port part of this object
-
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.
-
sameHostAs
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
- the addess to compare to- Returns:
- true, if
other
is on the same port asthis
-