Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Creating a socket in the AF_INET domain

&pagelevel(4)&pagelevel

The following call creates a stream socket in the Internet domain AF_INET:

s = socket(AF_INET, SOCK_STREAM, 0);

In this case, the underlying communications support is provided by the TCP protocol.

The following call creates a datagram socket in the Internet domain:

s = socket(AF_INET, SOCK_DGRAM, 0);

The UDP protocol used in this case transfers the datagrams without any further communications support to the underlying network services.