generated from ClemaX/ft_skeleton_cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Unix sockets
Clément Hamada edited this page May 7, 2021
·
6 revisions
Unix sockets provide a way to send data over network interfaces.
A socket connection has an address, composed of an IP address and a port. Computers can open multiple connections to and from the same addresses using different ports.
There are several functions used to manipulate sockets:
- socket: Creates an endpoint for communication and returns its associated file-descriptor.
- setsockopt: Set socket stream options.
- getsockopt: Get socket stream options.
- getsockname: Get the socket's associated name.
There are several functions used to manipulate network format numbers:
- inet_aton, inet_addr, inet_network: Interpret strings representing numbers in the internet standard '.' notation.
- inet_pton: Convert a presentation format address to network format.
- inet_aton: Interpret string as an internet address.
- inet_ntop: Convert an address from network format to presentation format.
- getprotobyname: Get a network protocol by name.
- gethostbyname: Get a network host's address from its hostname.