#include "libtorrent/asio.hpp"
#include "boost/bind.hpp"
#include <iostream>
void f()
{
?std::cout << "fwx" << std::endl;?
}
int main(int argc, char * argv)
{
?asio::io_service ser;??????????????????//利用CreateIoCompletionPort創(chuàng)建完全端口
?asio::deadline_timer dea(ser);??? //進行句柄關(guān)聯(lián)
?dea.expires_from_now(boost::posix_time::seconds(10));??
?dea.async_wait(boost::bind(f));??????????????????????????????????????? //這兩句相當于一個pair,要push到一個隊列當中,創(chuàng)建的線程會來取請求
?ser.run();?????????????????????????????????//利用GetQueuedCompletionStatus函數(shù)從完全端口中取已完成的請求
?return 0;
}