리눅스랑 코드 동기화

This commit is contained in:
2025-05-01 16:33:52 +09:00
parent d3161edb36
commit 4fb5bdd4cb
14 changed files with 279 additions and 144 deletions

View File

@@ -11,22 +11,13 @@ public:
Socket(int domain, int type, int protocol);
~Socket();
void init(int domain, int type, int protocol);
int init(int domain, int type, int protocol);
void destruct();
operator SOCKET();
void set(const SOCKET);
void set(const SOCKET __sock, int __domain);
void bind(sockaddr *__addr);
void bind(sockaddr *__addr, socklen_t __len);
//IPV4
void bind(sockaddr_in *__addr);
void bind(sockaddr_in *__addr, socklen_t __len);
//IPV6
void bind(sockaddr_in6 *__addr);
void bind(sockaddr_in6 *__addr, socklen_t __len);
int bind(Address __addr);
int recvfrom(void *__restrict __buf, size_t __n, int __flags, struct Address& __addr);
int sendto(const void *__buf, size_t __n, int __flags, struct Address __addr);
@@ -37,6 +28,9 @@ public:
Socket& operator=(Socket&&);
struct Address bindAddr = {};
struct Address remoteAddr = {};
int domain = 0;
protected:
bool valid_ = false;
SOCKET sock_ = INVALID_SOCKET;