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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user