|
Boost : |
From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2005-09-04 07:10:26
I tried modified the timer1.cpp a little:
#include <iostream>
#include <asio.hpp>
asio::demuxer d;
int main()
{
asio::deadline_timer t(d, boost::posix_time::seconds(5));
t.wait();
std::cout << "Hello, world!\n";
return 0;
}
by moving the demuxer object to global scope.
I have to be honest, I am not through with the documentation yet,
but also I did not find a bold mark which prohibits such
use.
At least the program seems to never end, it seems to hang somewhere
in the library clean up code? I can see it waiting for a thread to stop:
// Wait for the thread to exit.
void join()
{
::WaitForSingleObject(thread_, INFINITE);
}
But this never happens.
Is it true indeed, that demuxer s must not be at global scope?
Regards,
Roland
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk