Hi,

Apparently TThreadedServer (and TThreadPoolServer) does not stop the
tasks that are waiting on a persistent connection even if the server is
halted with stop() or its transport is closed.

Looking at the code (ThreadedServer.cpp) it seems TThreadedServer is
waiting here:

230      Synchronized s(tasksMonitor_);
231      while (!tasks_.empty()) {
232        tasksMonitor_.wait();
233      }

The task is stuck here:

61      while (processor_->process(input_, output_)) {
62        if (!input_->getTransport()->peek()) {
63          break;
64        }
65      }

Which means that in the TSocket.cpp code the task is waiting here:

108     int r = recv(socket_, &buf, 1, MSG_PEEK);

The socket is local, so it never gets invalidated thus waiting forever.

Any suggestion?

--
Norman

Reply via email to