From f8e00791c1b318b59a358398c90e8774eb1fcace Mon Sep 17 00:00:00 2001 From: Kizarm Date: Fri, 25 Oct 2024 19:58:06 +0200 Subject: [PATCH] small change --- V203/usb/scope/server/main.cpp | 2 +- V203/usb/scope/server/wsclient.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/V203/usb/scope/server/main.cpp b/V203/usb/scope/server/main.cpp index 7d148b4..2e12a5f 100644 --- a/V203/usb/scope/server/main.cpp +++ b/V203/usb/scope/server/main.cpp @@ -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) { diff --git a/V203/usb/scope/server/wsclient.cpp b/V203/usb/scope/server/wsclient.cpp index 2bdc852..70b883e 100644 --- a/V203/usb/scope/server/wsclient.cpp +++ b/V203/usb/scope/server/wsclient.cpp @@ -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);