File tree 1 file changed +1
-12
lines changed
1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -177,21 +177,10 @@ void Socket::close()
177
177
// Make the socket request close.
178
178
d->next_state = SocketState::Closing;
179
179
180
- int timeout = 0 ;
181
180
// Wait with closing until we properly clear the send queue.
182
- while (d->next_state == SocketState::Closing || d-> state == SocketState::Closing)
181
+ while (d->state == SocketState::Closing)
183
182
{
184
183
std::this_thread::sleep_for (std::chrono::milliseconds (100 ));
185
-
186
- // In certain situations, the socket seems to stall on recv.
187
- timeout += 100 ;
188
- if (timeout > 1000 )
189
- {
190
- d->error (ErrorCode::ReceiveFailedError, " Failed to cleanly close socket, force closing it" );
191
- d->platform_socket .shutdown (PlatformSocket::ShutdownDirection::ShutdownBoth);
192
- d->platform_socket .close ();
193
- d->next_state = SocketState::Error;
194
- }
195
184
}
196
185
}
197
186
else
You can’t perform that action at this time.
0 commit comments