#pragma once #include "precomp.hpp" #include "Address.hpp" namespace Chattr { class Socket { public: Socket(); Socket(int domain, int type, int protocol); ~Socket(); void init(int domain, int type, int protocol); operator SOCKET() const; void move(const SOCKET); 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); Socket(const Socket&) = delete; Socket& operator=(const Socket&) = delete; struct Address bindAddr = {}; protected: bool valid_ = false; SOCKET sock_ = INVALID_SOCKET; }; }