added session::set_alert_dispatch() for system specific message loop integration

This commit is contained in:
Arvid Norberg
2008-12-15 07:12:08 +00:00
parent 8f308ef881
commit f1d981254a
7 changed files with 43 additions and 0 deletions

View File

@@ -101,6 +101,11 @@ void test_rate()
}
void print_alert(alert const& a)
{
std::cout << "ses1 (alert dispatch function): " << a.message() << std::endl;
}
void test_transfer()
{
session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48075, 49000));
@@ -134,6 +139,7 @@ void test_transfer()
ses1.set_alert_mask(alert::all_categories & ~alert::progress_notification);
ses2.set_alert_mask(alert::all_categories & ~alert::progress_notification);
ses1.set_alert_dispatch(&print_alert);
for (int i = 0; i < 30; ++i)
{