GATE
|
Classes | |
struct | Endpoint |
Public Types | |
enum | FamilyEnum { Family_None = GATE_SOCKET_FAMILY_NONE , Family_Unix = GATE_SOCKET_FAMILY_UNIX , Family_Inet4 = GATE_SOCKET_FAMILY_INET4 , Family_Ipx = GATE_SOCKET_FAMILY_IPX , Family_AppleTalk = GATE_SOCKET_FAMILY_APPLETALK , Family_NetBios = GATE_SOCKET_FAMILY_NETBIOS , Family_Atm = GATE_SOCKET_FAMILY_ATM , Family_Inet6 = GATE_SOCKET_FAMILY_INET6 , Family_Irda = GATE_SOCKET_FAMILY_IRDA , Family_Bth = GATE_SOCKET_FAMILY_BTH } |
enum | MsgTypeEnum { MsgType_None = GATE_SOCKET_MSGTYPE_NONE , MsgType_Stream = GATE_SOCKET_MSGTYPE_STREAM , MsgType_Datagram = GATE_SOCKET_MSGTYPE_DATAGRAM , MsgType_Raw = GATE_SOCKET_MSGTYPE_RAW } |
enum | ProtocolEnum { Protocol_Ip = GATE_SOCKET_PROTOCOL_IP , Protocol_Icmp = GATE_SOCKET_PROTOCOL_ICMP , Protocol_Igmp = GATE_SOCKET_PROTOCOL_IGMP , Protocol_Tcp = GATE_SOCKET_PROTOCOL_TCP , Protocol_Udp = GATE_SOCKET_PROTOCOL_UDP , Protocol_Ip6 = GATE_SOCKET_PROTOCOL_IP6 , Protocol_Icmp6 = GATE_SOCKET_PROTOCOL_ICMP6 } |
enum | SocketTypeEnum { SocketType_Tcp4 = GATE_SOCKET_TYPE_TCP4 , SocketType_Udp4 = GATE_SOCKET_TYPE_UDP4 , SocketType_Icmp4 = GATE_SOCKET_TYPE_ICMP4 , SocketType_Tcp6 = GATE_SOCKET_TYPE_TCP6 , SocketType_Udp6 = GATE_SOCKET_TYPE_UDP6 , SocketType_Icmp6 = GATE_SOCKET_TYPE_ICMP6 } |
enum | OptionEnum { Option_Blocking = GATE_SOCKET_OPTION_BLOCKING , Option_TcpNoDelay = GATE_SOCKET_OPTION_TCPNODELAY , Option_KeepAlive = GATE_SOCKET_OPTION_KEEPALIVE , Option_Broadcast = GATE_SOCKET_OPTION_BROADCAST , Option_ReceiveTimeout = GATE_SOCKET_OPTION_RECEIVETIMEOUT , Option_SendTimeout = GATE_SOCKET_OPTION_SENDTIMEOUT } |
enum | SelectStatusEnum { SelectStatus_Receive = GATE_SOCKET_SELECT_FLAG_RECEIVE , SelectStatus_Send = GATE_SOCKET_SELECT_FLAG_SEND , SelectStatus_Error = GATE_SOCKET_SELECT_FLAG_ERROR } |
typedef gate_socket_ip4address_t | Ip4Address |
typedef gate_socket_ip6address_t | Ip6Address |
Public Member Functions | |
Socket (SocketTypeEnum socktype) | |
Socket (FamilyEnum family, MsgTypeEnum msgtype, ProtocolEnum protocol) | |
void | connect (Endpoint const &endpoint) |
void | connect (String const &address) |
Result< Void > | tryConnect (Endpoint const &endpoint) noexcept |
Result< Void > | tryConnect (String const &address) noexcept |
void | bind (Endpoint const &endpoint) |
void | bind (String const &address) |
Result< Void > | tryBind (Endpoint const &endpoint) noexcept |
Result< Void > | tryBind (String const &address) noexcept |
void | listen (int32_t backlog=0) |
Result< Void > | tryListen (int32_t backlog=0) noexcept |
void | accept (Socket &socket) |
Result< Void > | tryAccept (Socket &socket) noexcept |
size_t | receive (char *buffer, size_t bufferlen) |
Result< size_t > | tryReceive (char *buffer, size_t bufferlen) noexcept |
size_t | receiveFrom (Endpoint &endpoint, char *buffer, size_t bufferlen, uint16_t flags=0) |
Result< size_t > | tryReceiveFrom (Endpoint &endpoint, char *buffer, size_t bufferlen, uint16_t flags=0) noexcept |
size_t | send (char const *buffer, size_t bufferlen) |
Result< size_t > | trySend (char const *buffer, size_t bufferlen) noexcept |
size_t | sendTo (Endpoint const &endpoint, char const *buffer, size_t bufferlen, uint16_t flags=0) |
Result< size_t > | trySendTo (Endpoint const &endpoint, char const *buffer, size_t bufferlen, uint16_t flags=0) noexcept |
void | shutdown (bool shutdownReceive, bool shutdownSend) |
Result< Void > | tryShutdown (bool shutdownReceive, bool shutdownSend) noexcept |
void | close () noexcept |
size_t | getOption (int32_t level, int32_t option, void *buffer, size_t bufferlen) |
void | setOption (int32_t level, int32_t option, void const *buffer, size_t bufferlen) |
void | setOption (OptionEnum option, int32_t value) |
Endpoint | getLocalEndpoint () |
String | getLocalAddress () |
Endpoint | getRemoteEndpoint () |
String | getRemoteAddress () |
gate_socket_t * | c_impl () |
gate_socket_t const * | c_impl () const |
void | swap (Socket &that) noexcept |
bool | valid () const noexcept |
void | select (bool *canRead, bool *canWrite, bool *hasError, uint32_t timeout_ms=0) |
Result< Void > | trySelect (bool *canRead, bool *canWrite, bool *hasError, uint32_t timeout_ms=0) |
Static Public Member Functions | |
static void | select (Socket const *sockets, size_t socket_count, uint8_t *statusFlags, uint32_t timeout) |
static Ip4Address | parseIp4 (String const &ip4text) |
static Ip6Address | parseIp6 (String const &ip6text) |
static Endpoint | parseAddress (String const &address) |
static String | printAddress (Endpoint const &endpoint) |