Skip to content

Commit

Permalink
Prevent poll for closed socket
Browse files Browse the repository at this point in the history
  • Loading branch information
VladSemenyuk committed May 20, 2022
1 parent 65947fd commit 6afb12c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ void ThreadedSocketConnection::Transmit() {
poll_fds[1].events = POLLIN | POLLPRI;

SDL_LOG_TRACE("poll " << this);
if (-1 == socket_) {
SDL_LOG_TRACE("Socket is closed.");
return;
}
if (-1 == poll(poll_fds, kPollFdsSize, -1)) {
SDL_LOG_ERROR_WITH_ERRNO("poll failed for connection " << this);
Abort();
Expand Down

0 comments on commit 6afb12c

Please sign in to comment.