Skip to content
Snippets Groups Projects
Commit 987480f6 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Handle WSAPoll errors

parent 84c49184
No related branches found
No related tags found
No related merge requests found
......@@ -489,11 +489,18 @@ void Universe::_run() {
//Some kind of error occured, it is usually possible to recover from this.
if (selres < 0) {
#ifdef WIN32
int errNum = WSAGetLastError();
switch (errNum) {
default : LOG(WARNING) << "Unhandled poll error: " << errNum;
}
#else
switch (errno) {
case 9 : continue; // Bad file descriptor = socket closed
case 4 : continue; // Interrupted system call ... no problem
default : LOG(WARNING) << "Unhandled select error: " << strerror(errno) << "(" << errno << ")";
default : LOG(WARNING) << "Unhandled poll error: " << strerror(errno) << "(" << errno << ")";
}
#endif
continue;
} else if (selres == 0) {
// Timeout, nothing to do...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment