update to upnp test

This commit is contained in:
Arvid Norberg 2010-09-30 08:53:16 +00:00
parent c17c1605d7
commit a6cb426256
1 changed files with 7 additions and 9 deletions

View File

@ -61,18 +61,18 @@ int main(int argc, char* argv[])
return 1; return 1;
} }
session* s = new session; session s;
s->set_alert_mask(alert::port_mapping_notification); s.set_alert_mask(alert::port_mapping_notification);
for (;;) for (;;)
{ {
alert const* a = s->wait_for_alert(seconds(5)); alert const* a = s.wait_for_alert(seconds(5));
if (a == 0) if (a == 0)
{ {
s->stop_upnp(); s.stop_upnp();
break; break;
} }
std::auto_ptr<alert> holder = s->pop_alert(); std::auto_ptr<alert> holder = s.pop_alert();
print_alert(holder.get()); print_alert(holder.get());
} }
@ -80,14 +80,12 @@ int main(int argc, char* argv[])
for (;;) for (;;)
{ {
alert const* a = s->wait_for_alert(seconds(5)); alert const* a = s.wait_for_alert(seconds(5));
if (a == 0) break; if (a == 0) break;
std::auto_ptr<alert> holder = s->pop_alert(); std::auto_ptr<alert> holder = s.pop_alert();
print_alert(holder.get()); print_alert(holder.get());
} }
delete s;
s = 0;
return 0; return 0;
} }