ICI Modules: net: socket


Modules by name : by type

Synopsis

socket = net.socket([int | string])

Description

Create and return a socket object. The optional argument defines either the protocol to use with this socket or gives an integer file descriptor for which a socket object is desired. Currently only TCP and UDP sockets are supported. The protocol is one of the strings "tcp", "tcp/ip", "udp", "udp/ip". The default, if no argument is passed, being "tcp". The notation "protocol/transport" will be used at some later stage to allow other types of sockets to be created.

If the protocol is unknown or the socket cannot be created for some reason an appropriate error is raised otherwise a new socket object is returned.