-
Notifications
You must be signed in to change notification settings - Fork 0
POSIX Platform Examples
Niki Mardari edited this page Apr 2, 2026
·
5 revisions
- Linux
- macOS
- Other POSIX-compliant systems
These examples were developed on macOS and rely on standard POSIX APIs.
Tools useful for debugging:
- nc
- netcat
- tcpdump
Demonstrates how to:
- Create a TCP socket
- Connect to a remote HTTP server
- Send an HTTP/1.1 request
- Receive and print the response
- Convert IPv4 string to network address
- Create TCP socket
- Connect to remote server
- Send HTTP request
- Receive response
- Close socket
Command-line utility to resolve a hostname into IPv4 addresses using getaddrinfo()
- Demonstrates modern DNS resolution
- Shows linked-list iteration of addrinfo results
- Introduces non-blocking connect with timeout
- getaddrinfo()
- inet_ntop()
- non-blocking sockets
- poll()