1sock_listen(3z)            z88dk Programmer's Manual           sock_listen(3z)
2
3
4

NAME

6       sock_listen - open a passive network connection
7

SYNOPSIS

9       #include <net/socket.h>
10
11       SOCKET *sock_listen(ipaddr_t ipdest, tcpport_t lport,
12                          void (*handler)(), char proto);
13

DESCRIPTION

15       The  sock_listen()  function  creates a socket descriptor for a passive
16       (i.e. listening) connection on local port lport awaiting  a  connection
17       from  host  ipdest.  At the moment only protocols prot_UDP and prot_TCP
18       are supported.
19
20       To accept connections from any host specify the parameter ipdest to  be
21       0L.
22
23       The  parameter  handler  specifies  a handler to be called whenever the
24       connection changes state or new data arrives. It should be the code for
25       a package routine.
26
27       The  input parameters of the function handler vary depending on whether
28       the socket is of type prot_UDP or prot_TCP.
29
30

RETURN VALUE

32       sock_listen() returns a socket descriptor.  Specifying  a  non  support
33       protocol  will  result in the carry flag being set and the return value
34       being EPROTONOSUPPORT.
35
36

SEE ALSO

38       sock_open(3z)
39
40

AUTHOR

42       Dominic Morris <dom@jb.man.ac.uk>
43
44
45
46
47                               18 February 2000                sock_listen(3z)
Impressum