검색결과 리스트
글
[-] Collapse
#define _WIN32_WINNT 0x0501
#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
int main()
{
boost::asio::io_service io;
boost::asio::deadline_timer t( io, boost::posix_time::seconds( 10 ) );
std::cout << "test" << std::endl;
t.wait(); // 10초 동안 대기. blocking
std::cout << "ttttt" << std::endl;
}
블록모드. 10초동안 대기를 명하고, wait를 만나게 되면 10초동안 말 그대로 wait(대기) 한다. 만약 wait 명령어를 호출 해주지 않는다면, 그냥 패스~#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
int main()
{
boost::asio::io_service io;
boost::asio::deadline_timer t( io, boost::posix_time::seconds( 10 ) );
std::cout << "test" << std::endl;
t.wait(); // 10초 동안 대기. blocking
std::cout << "ttttt" << std::endl;
}
'Programming > Boost' 카테고리의 다른 글
asio - TCP_server( async ) (0) | 2009.12.01 |
---|---|
Bind 공부중인거 정리. < 01 > (0) | 2009.08.20 |
Signal 공부중인거 정리. < 04 > (0) | 2009.08.20 |
Signal 공부중인거 정리. < 03 > (0) | 2009.08.20 |
Signal 공부중인거 정리. < 02 > - 1 (0) | 2009.08.19 |
RECENT COMMENT