sock_open(3z)

NAME
sock_open - open an active network connection

SYNOPSIS
#include <net/socket.h>

SOCKET *sock_open(ipaddr_t ipdest, tcpport_t dport,
                   void (*handler)(), char proto);

DESCRIPTION
The sock_open() function creates a socket descriptor and attempts to establish a connection to the port dport on the host ipdest using the protocol proto. At the moment only protocols prot_UDP and prot_TCP are supported.

The parameter handler specifies a handler to be called whenever the connection changes state or new data arrives. It is of archaic interest only.

RETURN VALUE
sock_open() returns a socket descriptor. Specifying a non-supported protocol will result in the carry flag being set and the return value being EPROTONOSUPPORT.

SEE ALSO
sock_listen(3z)

AUTHOR
Dominic Morris <dom@jb.man.ac.uk>