diff --git a/panda/src/net/connection.cxx b/panda/src/net/connection.cxx index 3e7bd02229..17ca4211ca 100644 --- a/panda/src/net/connection.cxx +++ b/panda/src/net/connection.cxx @@ -136,7 +136,12 @@ send_datagram(const NetDatagram &datagram) { PR_Unlock(_write_mutex); if (result < 0) { - if (errcode == PR_CONNECT_RESET_ERROR) { + if (errcode == PR_CONNECT_RESET_ERROR +#ifdef PR_SOCKET_SHUTDOWN_ERROR + || errcode == PR_SOCKET_SHUTDOWN_ERROR + || errcode == PR_CONNECT_ABORTED_ERROR +#endif + ) { // The connection has been reset; tell our manager about it // and ignore it. if (_manager != (ConnectionManager *)NULL) { diff --git a/panda/src/net/connectionReader.cxx b/panda/src/net/connectionReader.cxx index 39cf00eb4d..47ffd17050 100644 --- a/panda/src/net/connectionReader.cxx +++ b/panda/src/net/connectionReader.cxx @@ -504,7 +504,12 @@ process_incoming_tcp_data(SocketInfo *sinfo) { if (bytes_read < 0) { PRErrorCode errcode = PR_GetError(); - if (errcode == PR_CONNECT_RESET_ERROR) { + if (errcode == PR_CONNECT_RESET_ERROR +#ifdef PR_SOCKET_SHUTDOWN_ERROR + || errcode == PR_SOCKET_SHUTDOWN_ERROR + || errcode == PR_CONNECT_ABORTED_ERROR +#endif + ) { // The socket was closed. if (_manager != (ConnectionManager *)NULL) { _manager->connection_reset(sinfo->_connection); @@ -557,7 +562,12 @@ process_incoming_tcp_data(SocketInfo *sinfo) { if (bytes_read < 0) { PRErrorCode errcode = PR_GetError(); - if (errcode == PR_CONNECT_RESET_ERROR) { + if (errcode == PR_CONNECT_RESET_ERROR +#ifdef PR_SOCKET_SHUTDOWN_ERROR + || errcode == PR_SOCKET_SHUTDOWN_ERROR + || errcode == PR_CONNECT_ABORTED_ERROR +#endif + ) { // The socket was closed. if (_manager != (ConnectionManager *)NULL) { _manager->connection_reset(sinfo->_connection);