Mwnci socket() Function

Syntax

socket(string)

Description

The socket() function returns a file descriptor corresponding to the created socket.

A socket is set using one of the following:

"unix"
"tcp4"
"udp4"
"tcp6"
"udp6"

Example

include("file")
fd = socket("tcp4")
bind(fd, "0.0.0.0:8000")
listen(fd, 1)