/
socket TCP UDP
socket TCP UDP
Create a datagram (i.e., UDP) or stream (i.e., TCP) type socket. See function NetSock_Open() for more information.
Files
net_bsd.h/net_bsd.c
Prototype
int socket (int protocol_family, int sock_type, int protocol);
Arguments
protocol_family
Socket protocol family:
PF_INET
Internet Protocol version 4 (IPv4).
sock_type
Socket type:
SOCK_DGRAM
Datagram-type socket.
SOCK_STREAM
Stream-type socket.
protocol
Socket protocol:
0
Default protocol for socket type.
IPPROTO_UDP
User Datagram Protocol (UDP).
IPPROTO_TCP
Transmission Control Protocol (TCP).
Returned Value
Socket descriptor/handle identifier, if no error(s).
-1, otherwise.
, multiple selections available,
Related content
NetSock_Open
NetSock_Open
More like this
send / sendto TCP UDP
send / sendto TCP UDP
More like this
accept TCP
accept TCP
More like this
bind TCP UDP
bind TCP UDP
More like this
connect TCP UDP
connect TCP UDP
More like this
listen TCP
listen TCP
More like this