Loading src/eventapi.h +0 −4 Original line number Diff line number Diff line Loading @@ -34,10 +34,6 @@ #pragma once #ifndef Windows typedef unsigned long long ULONG_PTR; #endif namespace netplus { class EventWorker; class pollapi; Loading src/posix/socket.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -50,17 +50,20 @@ #define HIDDEN __attribute__ ((visibility ("hidden"))) #define ADDRMAXSIZE 256 std::atomic<int> netplus::socket::_InitCount(0); netplus::socket::socket(){ _SocketInfo=(ULONG_PTR)::malloc(sizeof(sockaddr)); _SocketInfoLen=sizeof(sockaddr); _SocketInfo=malloc(ADDRMAXSIZE); _SocketInfoLen=sizeof(struct sockaddr); _Type=-1; ++_InitCount; } netplus::socket::~socket(){ --_InitCount; free(_SocketInfo); } void netplus::socket::setnonblocking(){ Loading src/posix/tcp.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,8 @@ netplus::tcp::tcp(const char* addr, int port,int maxconnections,int sockopts) : rp->ai_protocol); if (_Socket == -1) continue; memcpy((void*)_SocketInfo,rp,sizeof(struct addrinfo)); memcpy((void*)_SocketInfo,rp,sizeof(hints)); ((struct addrinfo*)_SocketInfo)->ai_next=nullptr; _SocketInfoLen=sizeof(rp); break; Loading src/posix/udp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -103,9 +103,9 @@ netplus::udp::udp(const char* addr, int port,int maxconnections,int sockopts) : rp->ai_protocol); if (_Socket == -1) continue; memcpy((void*)_SocketInfo,rp,sizeof(struct addrinfo)); memcpy((void*)_SocketInfo,rp,sizeof(hints)); ((struct addrinfo*)_SocketInfo)->ai_next=nullptr; _SocketInfoLen=sizeof(rp); break; } Loading src/socket.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ #ifndef Windows typedef int SOCKET; typedef unsigned long long ULONG_PTR; typedef void* ULONG_PTR; #else #include <WinSock2.h> #endif Loading Loading
src/eventapi.h +0 −4 Original line number Diff line number Diff line Loading @@ -34,10 +34,6 @@ #pragma once #ifndef Windows typedef unsigned long long ULONG_PTR; #endif namespace netplus { class EventWorker; class pollapi; Loading
src/posix/socket.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -50,17 +50,20 @@ #define HIDDEN __attribute__ ((visibility ("hidden"))) #define ADDRMAXSIZE 256 std::atomic<int> netplus::socket::_InitCount(0); netplus::socket::socket(){ _SocketInfo=(ULONG_PTR)::malloc(sizeof(sockaddr)); _SocketInfoLen=sizeof(sockaddr); _SocketInfo=malloc(ADDRMAXSIZE); _SocketInfoLen=sizeof(struct sockaddr); _Type=-1; ++_InitCount; } netplus::socket::~socket(){ --_InitCount; free(_SocketInfo); } void netplus::socket::setnonblocking(){ Loading
src/posix/tcp.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,8 @@ netplus::tcp::tcp(const char* addr, int port,int maxconnections,int sockopts) : rp->ai_protocol); if (_Socket == -1) continue; memcpy((void*)_SocketInfo,rp,sizeof(struct addrinfo)); memcpy((void*)_SocketInfo,rp,sizeof(hints)); ((struct addrinfo*)_SocketInfo)->ai_next=nullptr; _SocketInfoLen=sizeof(rp); break; Loading
src/posix/udp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -103,9 +103,9 @@ netplus::udp::udp(const char* addr, int port,int maxconnections,int sockopts) : rp->ai_protocol); if (_Socket == -1) continue; memcpy((void*)_SocketInfo,rp,sizeof(struct addrinfo)); memcpy((void*)_SocketInfo,rp,sizeof(hints)); ((struct addrinfo*)_SocketInfo)->ai_next=nullptr; _SocketInfoLen=sizeof(rp); break; } Loading
src/socket.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ #ifndef Windows typedef int SOCKET; typedef unsigned long long ULONG_PTR; typedef void* ULONG_PTR; #else #include <WinSock2.h> #endif Loading