org.mpisws.p2p.transport.simpleidentity
Class MutableInetSocketAddressStrategy
java.lang.Object
org.mpisws.p2p.transport.simpleidentity.MutableInetSocketAddressStrategy
- Type Parameters:
InetSocketAddress -
- All Implemented Interfaces:
- LocalIdentifierStrategy<InetSocketAddress>
public class MutableInetSocketAddressStrategy
- extends Object
- implements LocalIdentifierStrategy<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<InetSocketAddress> serializer)
getLocalIdentifierBytes
public byte[] getLocalIdentifierBytes()
throws IOException
- Specified by:
getLocalIdentifierBytes in interface LocalIdentifierStrategy<InetSocketAddress>
- Throws:
IOException
serializeAddress
protected byte[] serializeAddress(InetSocketAddress addr)
throws IOException
- Throws:
IOException
getLocalAddress
protected InetAddress getLocalAddress()
throws IOException
- Can be overridden to do something special in the case of having multiple NICs
- Returns:
- the current address to advertise
- Throws:
IOException
Copyright © 2010. All Rights Reserved.