Loading src/posix/tcp.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -142,19 +142,23 @@ tcp::tcp(const std::string& addr, int port, int maxconnections, int sockopts) } void tcp::bind() { if (_Bound) return; if (::bind(_Socket, reinterpret_cast<sockaddr*>(&_Addr), _AddrLen) < 0) { NetException e; e[NetException::Error] << "tcp::bind failed: " << strerror(errno); throw e; } _Bound = true; } void tcp::listen() { if (_Listening) return; if (::listen(_Socket, _Maxconnections) < 0) { NetException e; e[NetException::Critical] << "tcp::listen failed: " << strerror(errno); throw e; } _Listening = true; } void tcp::setNonBlock() { Loading src/posix/udp.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -138,15 +138,18 @@ udp::udp(const std::string& uxsocket, int maxconnections, int sockopts) } void udp::bind() { if (_Bound) return; if (::bind(_Socket, reinterpret_cast<sockaddr*>(&_Addr), _AddrLen) < 0) { NetException e; e[NetException::Error] << "udp::bind failed: " << strerror(errno); throw e; } _Bound = true; } void udp::listen() { // UDP has no listen _Listening = true; } void udp::setNonBlock() { Loading src/socket.h +3 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,9 @@ namespace netplus { int _Type; ULONG_PTR _Extension; bool _Bound = false; bool _Listening = false; protected: std::atomic<bool> _pendingIocpWrite{false}; // ✅ legacy helper still available Loading Loading
src/posix/tcp.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -142,19 +142,23 @@ tcp::tcp(const std::string& addr, int port, int maxconnections, int sockopts) } void tcp::bind() { if (_Bound) return; if (::bind(_Socket, reinterpret_cast<sockaddr*>(&_Addr), _AddrLen) < 0) { NetException e; e[NetException::Error] << "tcp::bind failed: " << strerror(errno); throw e; } _Bound = true; } void tcp::listen() { if (_Listening) return; if (::listen(_Socket, _Maxconnections) < 0) { NetException e; e[NetException::Critical] << "tcp::listen failed: " << strerror(errno); throw e; } _Listening = true; } void tcp::setNonBlock() { Loading
src/posix/udp.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -138,15 +138,18 @@ udp::udp(const std::string& uxsocket, int maxconnections, int sockopts) } void udp::bind() { if (_Bound) return; if (::bind(_Socket, reinterpret_cast<sockaddr*>(&_Addr), _AddrLen) < 0) { NetException e; e[NetException::Error] << "udp::bind failed: " << strerror(errno); throw e; } _Bound = true; } void udp::listen() { // UDP has no listen _Listening = true; } void udp::setNonBlock() { Loading
src/socket.h +3 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,9 @@ namespace netplus { int _Type; ULONG_PTR _Extension; bool _Bound = false; bool _Listening = false; protected: std::atomic<bool> _pendingIocpWrite{false}; // ✅ legacy helper still available Loading