🟨 Synchronous socket networking and DNS lookup
Socket library allows creating TCP / UDP sockets and using them as client or server and resolving DNS.
It can be used standalone if synchronous networking is preferred or as a companion to Async for creation of non-blocking socket descriptors.
Class | Description |
---|---|
SC::SocketDescriptor | Low-level OS socket handle. |
SC::SocketServer | Use a SocketDescriptor as a Server (example TCP or UDP Socket Server). |
SC::SocketClient | Use a SocketDescriptor as a client (example a TCP or UDP socket client). |
SC::SocketIPAddress | Native representation of an IP Address. |
SC::SocketDNS | Synchronous DNS Resolution. |
SC::SocketNetworking | Networking globals initialization (Winsock2 WSAStartup) |
🟨 MVP
Simple synchronous TCP client / server workflow is supported, but it would need better testing.
It also allow querying inheritability and changing it (and blocking mode)
Example (extracted from unit test):
Example:
The socket client can be obtained via SC::SocketServer::accept or connected to an endpoint through SC::SocketClient::connect.
Example (accepted client from server, doing a synchronous read):
Example (connecting client to server, doing two synchronous writes):
Example:
Example:
🟩 Usable
🟦 Complete Features:
💡 Unplanned Features: