small change

This commit is contained in:
Kizarm 2024-10-25 19:58:06 +02:00
parent 1095da2bea
commit f8e00791c1
2 changed files with 3 additions and 2 deletions

View file

@ -72,7 +72,7 @@ int main (int /*argc*/, const char * /*argv*/[]) {
epoll_ctl (myEpoll, EPOLL_CTL_ADD, server.fd(), &wakeSeasocks);
while (true) {
constexpr auto maxEvents = 2;
constexpr auto maxEvents = 10;
epoll_event events[maxEvents];
auto res = epoll_wait (myEpoll, events, maxEvents, -1);
if (res < 0) {

View file

@ -61,7 +61,7 @@ bool WsClient::start() {
printf ("Port %s opened (%d)\r\n", name, fd);
usleep (1000);
running = true;
return true;
return running;
}
void WsClient::stop() {
cout << "Client Stop\n";
@ -263,6 +263,7 @@ void WsClient::send_trig_mode() {
write (buffer, r);
}
int WsClient::write(const char * data, const int len) {
if (!running) return 0;
string out (data, len);
cout << out;
int r = ::write (fd, data, len);