When a peer connects to us, turn around and immediately connect back to them.
Don't wait up to 60 seconds for the next peer refresh interval. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5514 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -976,6 +976,24 @@ public abstract class PeerManager
|
||||
return new PeerCreds(_nodeName, _sharedSecret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a peer connects to this server.
|
||||
*/
|
||||
protected void peerStartedSession (PeerSession session)
|
||||
{
|
||||
// this may be the first we've heard of this guy, so let's refresh our peers and
|
||||
// potentially connect right back to him
|
||||
refreshPeers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a peer's session with this server ends.
|
||||
*/
|
||||
protected void peerEndedSession (PeerSession session)
|
||||
{
|
||||
// nothing presently
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when we have established a connection to the supplied peer.
|
||||
*/
|
||||
@@ -1234,8 +1252,7 @@ public abstract class PeerManager
|
||||
|
||||
// (this need not use a runqueue as all it will do is post an invoker unit)
|
||||
protected Interval _peerRefresher = new Interval() {
|
||||
@Override
|
||||
public void expired () {
|
||||
@Override public void expired () {
|
||||
refreshPeers();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user