Skip to content

Commit

Permalink
Change poll_fds from POLLIN to POLLRDNORM. WSAPoll consistently set P…
Browse files Browse the repository at this point in the history
…OLLRDNORM not POLLIN
  • Loading branch information
jacobbandyk committed Mar 25, 2024
1 parent 3caa75b commit 30cebbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mav/TCPServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace mav {
ConnectionPartner partner = {address.sin_addr.s_addr, address.sin_port, false};
_fd_to_partner.insert({client_socket, partner});
_partner_to_fd.insert({partner, client_socket});
_addFd(client_socket, POLLIN);
_addFd(client_socket, POLLRDNORM);
}

void _handleDisconnect(ConnectionPartner partner, int fd) {
Expand Down Expand Up @@ -202,7 +202,7 @@ namespace mav {
if (_poll_fds[i].revents == 0) {
continue;
}
if (_poll_fds[i].revents != POLLIN) {
if (_poll_fds[i].revents != POLLRDNORM) {
// error on socket
stop();
throw NetworkError("Error on socket");
Expand Down

0 comments on commit 30cebbb

Please sign in to comment.