Skip to content

Commit 3d2fd25

Browse files
debug add_fd
1 parent b67cccd commit 3d2fd25

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

game/src/engine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ void Engine::start_client_now(const char *host, uint16_t port, UI_TaskInfo &info
416416
Client *c = new Client(username);
417417
client.reset(c);
418418

419+
puts("Connecting to host");
419420
info.next("Connecting to host");
420421
c->start(host, port);
421422
}

game/src/net/net.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,16 @@ int ServerSocket::add_fd(SOCKET s) {
617617
ev.events = EPOLLIN | EPOLLOUT | EPOLLRDHUP | EPOLLET;
618618
ev.data.fd = (int)s;
619619

620-
return epoll_ctl(h, EPOLL_CTL_ADD, s, &ev);
620+
int r = epoll_ctl(h, EPOLL_CTL_ADD, s, &ev);
621+
#if _WIN32
622+
return r;
623+
#else
624+
if (r) {
625+
perror("add_fd: epoll_ctl_add");
626+
fprintf(stderr, "add_fd: fd=%d\n", s);
627+
}
628+
return r;
629+
#endif
621630
}
622631

623632
int ServerSocket::del_fd(SOCKET s) {

0 commit comments

Comments
 (0)