Function Socket (Domain,SocketType,Protocol:Longint) : Longint;
Socket creates a new socket in domain Domain, from type SocketType using protocol Protocol.
The Domain, Socket type and Protocol can be specified using predefined constants (see the section on constants for available constants)
If succesfull, the function returns a socket descriptor, which can be passed to a subsequent Bind call. If unsuccesfull, the function returns -1.
Errors are returned in SocketError, and include the follwing:
SocketPair, socket (2) for an example, see Accept.