mirror of
https://github.com/pocoproject/poco.git
synced 2025-06-13 09:22:08 +02:00
prevent TCPServer thread from stopping of poll() throws (due to resource issues)
This commit is contained in:
parent
830894792d
commit
2e8674a54d
@ -115,6 +115,8 @@ void TCPServer::run()
|
||||
while (!_stopped)
|
||||
{
|
||||
Poco::Timespan timeout(250000);
|
||||
try
|
||||
{
|
||||
if (_socket.poll(timeout, Socket::SELECT_READ))
|
||||
{
|
||||
try
|
||||
@ -143,6 +145,14 @@ void TCPServer::run()
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Poco::Exception& exc)
|
||||
{
|
||||
ErrorHandler::handle(exc);
|
||||
// possibly a resource issue since poll() failed;
|
||||
// give some time to recover before trying again
|
||||
Poco::Thread::sleep(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user