Added internal hostname reporting, documented other PeerNode methods.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5834 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2009-06-22 22:05:06 +00:00
parent 55f66f01da
commit fcda0f3156
2 changed files with 34 additions and 0 deletions
@@ -523,6 +523,20 @@ public abstract class PeerManager
return (peer == null) ? null : peer.getPublicHostName();
}
/**
* Returns the internal hostname to use when connecting to the specified peer or null if the
* peer is not currently connected to this server. Peers connect to one another via their
* internal hostname. Do not publish this data to clients out on the Internets.
*/
public String getPeerInternalHostName (String nodeName)
{
if (_nodeName.equals(nodeName)) {
return _self.hostName;
}
PeerNode peer = _peers.get(nodeName);
return (peer == null) ? null : peer.getInternalHostName();
}
/**
* Returns the port on which to connect to the specified peer or -1 if the peer is not
* currently connected to this server.