tcp/udp 추가, todo:iocp openssl 지원하도록 업데이트하기
This commit is contained in:
27
include/socket/address.h
Normal file
27
include/socket/address.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
namespace Socket {
|
||||
|
||||
struct Address {
|
||||
Address();
|
||||
Address(int type, gsl::czstring presentationAddr, std::uint16_t port);
|
||||
|
||||
void zeroFill();
|
||||
void set(int type, gsl::czstring presentationAddr, std::uint16_t port);
|
||||
void set(int type, in_addr_t addr, std::uint16_t port);
|
||||
void set(int type, in_addr addr, std::uint16_t port);
|
||||
void set(int type, in6_addr addr, std::uint16_t port);
|
||||
void setType(int type);
|
||||
|
||||
operator std::string();
|
||||
std::uint16_t getPort();
|
||||
|
||||
union {
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr_in;
|
||||
struct sockaddr_in6 addr_in6;
|
||||
};
|
||||
socklen_t length;
|
||||
};
|
||||
|
||||
} // namespace Chattr
|
||||
Reference in New Issue
Block a user