|
@@ -42,6 +42,15 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+ void boardcast(const std::vector<char>&msg)
|
|
|
+ {
|
|
|
+ for(auto i:m_thread_clts)
|
|
|
+ {
|
|
|
+ std::vector<char> tmp(msg);
|
|
|
+ i->send(std::move(tmp));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
void on_connect(std::shared_ptr<client> clt)
|
|
|
{
|
|
|
if(clt->handle()>=(int)m_thread_clts.size())
|
|
@@ -140,6 +149,7 @@ struct stdin_io:fd_io
|
|
|
|
|
|
virtual void operator()(ev::io &w, int)
|
|
|
{
|
|
|
+#if 0
|
|
|
char buf[256];
|
|
|
if(!gets(buf))
|
|
|
return;
|
|
@@ -152,6 +162,7 @@ struct stdin_io:fd_io
|
|
|
stop();
|
|
|
m_ic.stop();
|
|
|
}
|
|
|
+#endif
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -163,8 +174,8 @@ struct sock_client:fd_io,client_ex
|
|
|
int m_type=0;//site
|
|
|
|
|
|
char *m_b{0};
|
|
|
- int m_size{1<<16};
|
|
|
int m_clen{0};
|
|
|
+ int m_size{1<<16};
|
|
|
int m_max_package_size{4096};
|
|
|
|
|
|
ev::timer m_recv_timer;
|
|
@@ -513,10 +524,6 @@ struct main_loop:io_context
|
|
|
log_errno("block signal:%d",sig);
|
|
|
}
|
|
|
}
|
|
|
- void boardcast(const std::vector<char>&msg)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
};
|
|
|
|
|
|
|