Loading src/event/epoll.cpp +9 −1 Changes for src/event/epoll.cpp: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -180,10 +180,18 @@ namespace netplus { // clt->connection->csock=std::make_unique<ssl>( -1); } if (!ccon || !ccon->csock || ccon->csock->fd() < 0) { // The connection failed to establish or the socket is invalid. // Clean up and return, perhaps log an error. char errstr[255]; strerror_r_netplus(errno,errstr,255); std::cerr << "ConnectEventHandler: Failed to accept connection or invalid socket: " << errstr << std::endl; return; } _ServerSocket->accept(ccon->csock); ccon->csock->setFlag(O_NONBLOCK,1); std::string ip; ccon->csock->getAddress(ip); std::cout << "Connected: " << ip << std::endl; Loading src/event/kqueue.cpp +9 −2 Changes for src/event/kqueue.cpp: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -184,10 +184,18 @@ namespace netplus { // clt->connection->csock=std::make_unique<ssl>( -1); } if (!ccon || !ccon->csock || ccon->csock->fd() < 0) { // The connection failed to establish or the socket is invalid. // Clean up and return, perhaps log an error. char errstr[255]; strerror_r_netplus(errno,errstr,255); std::cerr << "ConnectEventHandler: Failed to accept connection or invalid socket: " << errstr << std::endl; return; } _ServerSocket->accept(ccon->csock); ccon->csock->setFlag(O_NONBLOCK,1); std::string ip; ccon->csock->getAddress(ip); std::cout << "Connected: " << ip << std::endl; Loading @@ -197,7 +205,6 @@ namespace netplus { struct kevent setevent {}; setevent.udata = ccon.get(); EV_SET(&setevent, ccon->csock->fd(), EVFILT_READ, EV_ADD | EV_ONESHOT,0,0,ccon.get()); int estate = kevent(_pollFD, &setevent, 1, nullptr, 0, nullptr); Loading Loading
src/event/epoll.cpp +9 −1 Changes for src/event/epoll.cpp: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -180,10 +180,18 @@ namespace netplus { // clt->connection->csock=std::make_unique<ssl>( -1); } if (!ccon || !ccon->csock || ccon->csock->fd() < 0) { // The connection failed to establish or the socket is invalid. // Clean up and return, perhaps log an error. char errstr[255]; strerror_r_netplus(errno,errstr,255); std::cerr << "ConnectEventHandler: Failed to accept connection or invalid socket: " << errstr << std::endl; return; } _ServerSocket->accept(ccon->csock); ccon->csock->setFlag(O_NONBLOCK,1); std::string ip; ccon->csock->getAddress(ip); std::cout << "Connected: " << ip << std::endl; Loading
src/event/kqueue.cpp +9 −2 Changes for src/event/kqueue.cpp: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -184,10 +184,18 @@ namespace netplus { // clt->connection->csock=std::make_unique<ssl>( -1); } if (!ccon || !ccon->csock || ccon->csock->fd() < 0) { // The connection failed to establish or the socket is invalid. // Clean up and return, perhaps log an error. char errstr[255]; strerror_r_netplus(errno,errstr,255); std::cerr << "ConnectEventHandler: Failed to accept connection or invalid socket: " << errstr << std::endl; return; } _ServerSocket->accept(ccon->csock); ccon->csock->setFlag(O_NONBLOCK,1); std::string ip; ccon->csock->getAddress(ip); std::cout << "Connected: " << ip << std::endl; Loading @@ -197,7 +205,6 @@ namespace netplus { struct kevent setevent {}; setevent.udata = ccon.get(); EV_SET(&setevent, ccon->csock->fd(), EVFILT_READ, EV_ADD | EV_ONESHOT,0,0,ccon.get()); int estate = kevent(_pollFD, &setevent, 1, nullptr, 0, nullptr); Loading