1.1.24.5 socket
C
int socket(int domain, int type, int protocol)Description
Create an endpoint for communication.
Parameters
| Parameters | Description |
|---|---|
| domain | Communication domain, must be AF_INET or AF_INET6. |
| type | Socket type, must be SOCK_STREAM or SOCK_DGRAM. |
| protocol | Specific socket protocol, should be zero or IPPROTO_TLS. |
Returns
Socket file descriptor or -1 for error (errno set).
Remarks
| errno | Description |
|---|---|
| EAFNOSUPPORT | The implementation does not support the specified address family. |
| EINVAL | Unknown protocol, or protocol family not available. |
| EPROTONOSUPPORT | The protocol type or the specified protocol is not supported within this domain. |
| EFAULT | System fault |
| ENFILE | The system-wide limit on the total number of open files has been reached. |
| ENOMEM | Insufficient memory is available. The socket cannot be created until sufficient resources are freed. |
| EBADMSG | Bad message. |
