File tree 1 file changed +14
-7
lines changed
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ void TCPServer::stop()
116
116
{
117
117
if (!_stopped)
118
118
{
119
+ _socket.close ();
119
120
_stopped = true ;
120
121
_thread.join ();
121
122
_pDispatcher->stop ();
@@ -150,24 +151,30 @@ void TCPServer::run()
150
151
}
151
152
catch (Poco::Exception& exc)
152
153
{
153
- ErrorHandler::handle (exc);
154
+ if (!_stopped)
155
+ ErrorHandler::handle (exc);
154
156
}
155
157
catch (std::exception & exc)
156
158
{
157
- ErrorHandler::handle (exc);
159
+ if (!_stopped)
160
+ ErrorHandler::handle (exc);
158
161
}
159
162
catch (...)
160
163
{
161
- ErrorHandler::handle ();
164
+ if (!_stopped)
165
+ ErrorHandler::handle ();
162
166
}
163
167
}
164
168
}
165
169
catch (Poco::Exception& exc)
166
170
{
167
- ErrorHandler::handle (exc);
168
- // possibly a resource issue since poll() failed;
169
- // give some time to recover before trying again
170
- Poco::Thread::sleep (50 );
171
+ if (!_stopped)
172
+ {
173
+ ErrorHandler::handle (exc);
174
+ // possibly a resource issue since poll() failed;
175
+ // give some time to recover before trying again
176
+ Poco::Thread::sleep (50 );
177
+ }
171
178
}
172
179
}
173
180
}
You can’t perform that action at this time.
0 commit comments