org.mpisws.p2p.transport.simpleidentity
Class MutableInetSocketAddressStrategy
java.lang.Object
org.mpisws.p2p.transport.simpleidentity.MutableInetSocketAddressStrategy
- Type Parameters:
InetSocketAddress
-
- All Implemented Interfaces:
- LocalIdentifierStrategy<java.net.InetSocketAddress>
public class MutableInetSocketAddressStrategy
- extends java.lang.Object
- implements LocalIdentifierStrategy<java.net.InetSocketAddress>
This is used if you are binding to 0.0.0.0
It will see if your local address changed before returning the serialized version.
- Author:
- Jeff Hoye
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MutableInetSocketAddressStrategy
public MutableInetSocketAddressStrategy(int port,
Serializer<java.net.InetSocketAddress> serializer)
getLocalIdentifierBytes
public byte[] getLocalIdentifierBytes()
throws java.io.IOException
- Specified by:
getLocalIdentifierBytes
in interface LocalIdentifierStrategy<java.net.InetSocketAddress>
- Throws:
java.io.IOException
serializeAddress
protected byte[] serializeAddress(java.net.InetSocketAddress addr)
throws java.io.IOException
- Throws:
java.io.IOException
getLocalAddress
protected java.net.InetAddress getLocalAddress()
throws java.io.IOException
- Can be overridden to do something special in the case of having multiple NICs
- Returns:
- the current address to advertise
- Throws:
java.io.IOException
Copyright © 2001-2005 - Rice Pastry.