您当前的位置: 首页 > 

phymat.nico

暂无认证

  • 1浏览

    0关注

    1967博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

boost之asio实现定时器使用实例

phymat.nico 发布时间:2017-10-19 16:18:27 ,浏览量:1

#ifndef TCP_SERVER_H
#define TCP_SERVER_H

#include "boost_comm.h"

#include "tcp_client.h"
#include "session_manager.h"
#include "command_machine.h"
#include "task_engine.h"
#include "search_engine.h"

using namespace boost::asio;

namespace seemmo
{
	class tcp_server
	{
	public:
		tcp_server(const char *ip, int port, bool enprint = true);
		~tcp_server();
	public:
		typedef ip::tcp::socket socket_type;
		typedef std::shared_ptr sock_ptr;
	protected:
		void run()
		{
			m_io.run();
		}

		void func_run()
		{
			func_io.run();
		}
		boost::asio::deadline_timer *m_timer;
		bool enable_print;
		/* boost::asio::placeholders::error*/
	public:
		void print()
		{
			using namespace boost::posix_time;
			ptime now = second_clock::local_time();
			string now_str = to_iso_extended_string(now.date()) + " " + to_simple_string(now.time_of_day());
			cout remote_endpoint().port();
		//LOG(INFO)            
关注
打赏
1659628745
查看更多评论
0.0428s