mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
Commit of the new UDP Connection methods and
the rewrite of the retroshare core networking stack. This check-in commits the changes to the upnp code. Modifications to use the new generic p3upnpmgr.h interface. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@310 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
456325dc08
commit
059d43244a
3 changed files with 166 additions and 196 deletions
|
@ -48,34 +48,7 @@ int main(int argc, char **argv)
|
|||
upnphandler upnp;
|
||||
|
||||
upnp.start();
|
||||
|
||||
#ifdef NOTEVER
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
dht.setOwnPort(port1);
|
||||
dht.setOwnHash(hash1);
|
||||
|
||||
dht.addFriend(hash2);
|
||||
dht.addFriend(hash3);
|
||||
}
|
||||
else if (id == 1)
|
||||
{
|
||||
dht.setOwnPort(port2);
|
||||
dht.setOwnHash(hash2);
|
||||
|
||||
dht.addFriend(hash1);
|
||||
dht.addFriend(hash3);
|
||||
}
|
||||
else
|
||||
{
|
||||
dht.setOwnPort(port3);
|
||||
dht.setOwnHash(hash3);
|
||||
|
||||
dht.addFriend(hash1);
|
||||
dht.addFriend(hash2);
|
||||
}
|
||||
#endif /* NOTEVER */
|
||||
upnp.setInternalPort(12122);
|
||||
|
||||
for(int i = 0; 1; i++)
|
||||
{
|
||||
|
@ -92,19 +65,17 @@ int main(int argc, char **argv)
|
|||
if (i % 300 == 10)
|
||||
{
|
||||
/* start up a forward */
|
||||
upnp.setupUPnPForwarding();
|
||||
upnp.enableUPnP(true);
|
||||
|
||||
}
|
||||
|
||||
if (i % 300 == 20)
|
||||
{
|
||||
/* shutdown a forward */
|
||||
upnp.shutdownUPnPForwarding();
|
||||
|
||||
}
|
||||
|
||||
upnp.enableUPnP(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue