Loading src/event/epoll.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -530,6 +530,7 @@ namespace netplus { _ServerSocket->bind(); _ServerSocket->setNonBlock(); _ServerSocket->listen(); _ServerSocket->setTimeout(timeout); threads=sysconf(_SC_NPROCESSORS_ONLN); } Loading src/posix/socket.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -78,10 +78,10 @@ void netplus::socket::setFlag(int flag,int value){ } } void netplus::socket::setTimeout(int sec){ void netplus::socket::setTimeout(int usec){ struct timeval timeout; timeout.tv_sec = sec; timeout.tv_usec = 0; timeout.tv_sec = 0; timeout.tv_usec = sec; if (setsockopt (_Socket, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout) < 0){ Loading src/socket.h +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ namespace netplus { void setFlag(int flag, int value); void setTimeout(int sec); void setTimeout(int usec); virtual void accept(std::unique_ptr<socket>& csock) = 0; #ifdef Windows Loading src/ssl.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1004,7 +1004,7 @@ void netplus::ssl::accept(std::unique_ptr<socket> &csock) // 1) Accept underlying TCP connection tcp::accept(csock); csock->setTimeout(1); csock->setTimeout(10000); // If accept failed or returned invalid socket if (!csock || csock->fd() < 0) { Loading src/windows/socket.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -116,6 +116,6 @@ void netplus::socket::copyAddrInfo(ULONG_PTR* dest, ULONG_PTR src, size_t srclen ((struct addrinfo*)*dest)->ai_socktype = ((struct addrinfo*)src)->ai_socktype; } void netplus::socket::setTimeout(int sec) { _Timeout = sec * 1000; void netplus::socket::setTimeout(int usec) { _Timeout = sec; } Loading
src/event/epoll.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -530,6 +530,7 @@ namespace netplus { _ServerSocket->bind(); _ServerSocket->setNonBlock(); _ServerSocket->listen(); _ServerSocket->setTimeout(timeout); threads=sysconf(_SC_NPROCESSORS_ONLN); } Loading
src/posix/socket.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -78,10 +78,10 @@ void netplus::socket::setFlag(int flag,int value){ } } void netplus::socket::setTimeout(int sec){ void netplus::socket::setTimeout(int usec){ struct timeval timeout; timeout.tv_sec = sec; timeout.tv_usec = 0; timeout.tv_sec = 0; timeout.tv_usec = sec; if (setsockopt (_Socket, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout) < 0){ Loading
src/socket.h +1 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ namespace netplus { void setFlag(int flag, int value); void setTimeout(int sec); void setTimeout(int usec); virtual void accept(std::unique_ptr<socket>& csock) = 0; #ifdef Windows Loading
src/ssl.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1004,7 +1004,7 @@ void netplus::ssl::accept(std::unique_ptr<socket> &csock) // 1) Accept underlying TCP connection tcp::accept(csock); csock->setTimeout(1); csock->setTimeout(10000); // If accept failed or returned invalid socket if (!csock || csock->fd() < 0) { Loading
src/windows/socket.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -116,6 +116,6 @@ void netplus::socket::copyAddrInfo(ULONG_PTR* dest, ULONG_PTR src, size_t srclen ((struct addrinfo*)*dest)->ai_socktype = ((struct addrinfo*)src)->ai_socktype; } void netplus::socket::setTimeout(int sec) { _Timeout = sec * 1000; void netplus::socket::setTimeout(int usec) { _Timeout = sec; }