zzj преди 5 години
родител
ревизия
b6d50b1b95
променени са 3 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 1 1
      net-service.cpp
  2. 3 3
      znet.cpp
  3. 1 1
      znet.h

+ 1 - 1
net-service.cpp

@@ -188,7 +188,7 @@ void net_service::on_message(const std::shared_ptr<client> &clt,const char*data,
             case CHAR_VIRTUAL_DATA_PUSH_CMD://虚拟数据链接
                 {
                     logn_info(1,"接收到虚拟链接:%s",clt->name().c_str());
-                    clt->set(2);
+                    clt->set_conn_type(2);
                 }
                 break;
 			default:

+ 3 - 3
znet.cpp

@@ -44,7 +44,7 @@ public:
 	{
 		m_thread_clts.reserve(2048);
 		m_timer.set<io_context,&io_context::on_timer>(this);
-		m_timer.start(0,0.1);
+		m_timer.start(0,1);
 	}
 
 	virtual ~io_context()
@@ -61,7 +61,7 @@ public:
 	}
 	void on_timer()
 	{
-		logn_info(1,"tick timer timeout.");
+//		logn_info(1,"tick timer timeout.");
 		m_serv.on_timer();	
 	}
 	void on_connect(const std::shared_ptr<client> &clt)
@@ -276,7 +276,7 @@ struct sock_client:fd_io,client_ex
 	{
 		return m_type;
 	}
-    void set(int t)
+    void set_conn_type(int t)
     {
         m_type=t;
     }

+ 1 - 1
znet.h

@@ -10,7 +10,7 @@ struct client:std::enable_shared_from_this<client>
 	virtual std::string name()=0;
 	virtual int type()=0;			//分站:1,模拟客户端:2
 	virtual int handle()=0;
-    virtual void set(int type)=0; //设置分站类型
+    virtual void set_conn_type(int type)=0; //设置分站类型1:site,2:虚拟推送客户端
 
 	virtual void close()=0;
 	virtual void send(std::vector<char>&&b)=0;