updated upnp test

This commit is contained in:
Arvid Norberg 2008-10-28 22:00:34 +00:00
parent 669da96ae2
commit ce9d9c760c
1 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,11 @@ using namespace libtorrent;
void callback(int mapping, int port, std::string const& err)
{
if (mapping == -1)
{
std::cerr << "UPnP: " << err << std::endl;
return;
}
std::cerr << "mapping: " << mapping << ", port: " << port << ", error: \"" << err << "\"\n";
}
@ -56,7 +61,7 @@ int main(int argc, char* argv[])
}
connection_queue cc(ios);
boost::intrusive_ptr<upnp> upnp_handler = new upnp(ios, cc, address_v4(), user_agent, &callback, true);
boost::intrusive_ptr<upnp> upnp_handler = new upnp(ios, cc, address_v4(), user_agent, &callback, false);
upnp_handler->discover_device();
libtorrent::deadline_timer timer(ios);