摘要: 异步服务器端: 1 #include <iostream> 2 #include <boost/asio.hpp> 3 #include <boost/bind.hpp> 4 #include <boost/shared_ptr.hpp> 5 #include <boost/date_time/posix_time/posix_time.hpp> 6 7 //using namespace std; 8 using namespace boost::asio; 9 10 class server11 {12 private:13 io 阅读全文
posted @ 2013-06-20 19:41 星语160523 阅读(922) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <boost/asio.hpp> 3 #include <boost/date_time/posix_time/posix_time.hpp> 4 using namespace boost::asio; 5 int main() 6 { 7 io_service ios; 8 deadline_timer t(ios,boost::posix_time::seconds(2)); 9 std::cout<<t.expires_at()<<std::endl;10 t. 阅读全文
posted @ 2013-06-20 17:35 星语160523 阅读(410) 评论(0) 推荐(0) 编辑
摘要: http://yumaoshu.com/?p=235C++的multiple definition of *** first defined here错误这两天写程序碰到个问题。那么久那么久终于解决了,其实很简单点问题。但既然付出了这么长时间,就让我永远记住它吧。。写篇日志(前面有两篇写了一半的大家说的那种垃圾流水账文,都没发……这里闲置好久好久了)首先我把出现这个现象的情况简化。我专门写了个测试程序,共有如下几个文件myClass.hmyClass1.hmyClass1.cppmain.cppmyClass.hmyClass1.h?12345678910111213141516#ifndef 阅读全文
posted @ 2013-06-20 12:39 星语160523 阅读(1799) 评论(0) 推荐(0) 编辑