sock_listen(3z)

NAME
sock_listen - open a passive network connection

SYNOPSIS
#include <net/socket.h>

SOCKET *sock_listen(ipaddr_t ipdest, tcpport_t lport,
                   void (*handler)(), char proto);

DESCRIPTION
The sock_listen() function creates a socket descriptor for a passive (i.e. listening) connection on local port lport awaiting a connection from host ipdest. At the moment only protocols prot_UDP and prot_TCP are supported.

To accept connections from any host specify the parameter ipdest to be 0L.

The parameter handler specifies a handler to be called whenever the connection changes state or new data arrives. It should be the code for a package routine.

The input parameters of the function handler vary depending on whether the socket is of type prot_UDP or prot_TCP.

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

SEE ALSO
sock_open(3z)

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