#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
查看更多评论