This commit is contained in:
2024-11-15 12:49:11 +03:00
parent 285f8de1f7
commit 221f595bcb
6 changed files with 23 additions and 16 deletions

View File

@@ -106,7 +106,7 @@ public:
std::vector<std::string> vsg;
std::ranges::transform(sig_range, std::back_inserter(vsg),
[](auto s) { return std::format("'{}'", sigdescr_np(s)); });
[](auto s) { return std::format("'{}' (No = {})", sigdescr_np(s), s); });
utils::AdcJoinRange(vsg, std::string_view(", "), sgs);
#else
@@ -184,7 +184,8 @@ protected:
virtual void signalReceived(std::error_code ec, int signo)
{
#ifdef _GNU_SOURCE
this->logInfo("The server received the signal: '{}' (ec = {})", sigdescr_np(signo), ec.message());
this->logInfo("The server received the signal: '{}' (No = {}, ec = {})", sigdescr_np(signo), signo,
ec.message());
#else
this->logInfo("The server received the signal: {} (ec = {})", signo, ec.message());
#endif

View File

@@ -259,6 +259,8 @@ public:
timer->cancel();
}
srv->_socket.set_option(asio::socket_base::keep_alive(true));
self.complete(ec, std::move(*srv));
srv.reset();
@@ -574,7 +576,7 @@ public:
if (!ec) {
if (do_read) {
do_read = false;
// do_read = false;
if (_receiveQueue.size()) { // return message from queue
timer->cancel();
auto imsg = _receiveQueue.front();
@@ -593,6 +595,8 @@ public:
}
auto buff = _streamBuffer.prepare(n_avail ? n_avail : 1);
do_read = false;
if constexpr (isTLS) {
return asio::async_read(_sessSocket, std::move(buff), asio::transfer_at_least(1),
std::move(self));
@@ -638,8 +642,9 @@ public:
auto net_pack = this->search(std::span(start_ptr, _streamBuffer.size()));
if (net_pack.empty()) {
do_read = true;
asio::post(std::move(self)); // initiate consequence socket's read operation
return;
return _socket.async_wait(asio::ip::tcp::socket::wait_read, std::move(self));
// asio::post(std::move(self)); // initiate consequence socket's read operation
// return;
}
timer->cancel(); // there were no errors in the asynchronous read-operation, so stop timer