use errno to get a more meaningful message...
...in case SDLNet_CheckSockets returns -1
This commit is contained in:
parent
f371473f1e
commit
8ae764677e
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <deque>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
@ -145,7 +146,7 @@ SOCKET_STATE receive_buf(TCPsocket sock, std::vector<char>& buf)
|
|||
}
|
||||
// wait for a maximum of 15 seconds for the socket to have activity
|
||||
if(SDLNet_CheckSockets(set, 15000) <= 0) {
|
||||
ERR_NW << "SDLNet_CheckSockets: " << SDLNet_GetError() << "\n";
|
||||
ERR_NW << "SDLNet_CheckSockets: " << strerror(errno) << "\n";
|
||||
SDLNet_TCP_DelSocket(set, sock);
|
||||
SDLNet_FreeSocketSet(set);
|
||||
return SOCKET_ERROR;
|
||||
|
|
Loading…
Add table
Reference in a new issue