1 | .\" roar_simple_play.3: |
---|
2 | |
---|
3 | .TH "roar_socket_listen" "3" "May 2011" "RoarAudio" "System Manager's Manual: RoarAudio" |
---|
4 | |
---|
5 | .SH NAME |
---|
6 | roar_socket_listen \- Opens a new listen socket |
---|
7 | |
---|
8 | .SH SYNOPSIS |
---|
9 | |
---|
10 | #include <roaraudio.h> |
---|
11 | |
---|
12 | int roar_socket_listen(int type, char * host, int port); |
---|
13 | |
---|
14 | .SH "DESCRIPTION" |
---|
15 | Opens a new listening socket for network clients to connect to. |
---|
16 | You may accept new connections via \fBaccept\fR(2). |
---|
17 | |
---|
18 | .SH "PARAMETERS" |
---|
19 | .TP |
---|
20 | \fBtype\fR |
---|
21 | The type of the Socket. See the list below. |
---|
22 | |
---|
23 | .TP |
---|
24 | \fBhost\fR |
---|
25 | The host or path name to listen on. |
---|
26 | This depends on the type argument. |
---|
27 | For TCP/IP to listen on any interface use a value of "0.0.0.0". |
---|
28 | |
---|
29 | .TP |
---|
30 | \fBport\fR |
---|
31 | The port number to listen on. |
---|
32 | This may be ignored by types not supporting port numbers. |
---|
33 | |
---|
34 | .SH "SOCKET TYPES" |
---|
35 | .TP |
---|
36 | \fBROAR_SOCKET_TYPE_UNKNOWN\fR |
---|
37 | The type will be auto detected. Don't use this if you know the type. Only use this |
---|
38 | to support user given addresses and enable auto detection. |
---|
39 | |
---|
40 | .TP |
---|
41 | \fBROAR_SOCKET_TYPE_TCP\fR |
---|
42 | Use a TCP/IP connection. This is standard mode for networking. |
---|
43 | \fBhost\fR is the hostname or IP to listen on and \fBport\fR is the port number to use. |
---|
44 | |
---|
45 | .TP |
---|
46 | \fBROAR_SOCKET_TYPE_INET\fR |
---|
47 | Same as above but deprecated. Use \fBROAR_SOCKET_TYPE_TCP\fR. |
---|
48 | |
---|
49 | .TP |
---|
50 | \fBROAR_SOCKET_TYPE_UNIX\fR |
---|
51 | UNIX Domain Socket. This should be default for local connections. |
---|
52 | \fBhost\fR is the filename of the socket. |
---|
53 | |
---|
54 | .TP |
---|
55 | \fBROAR_SOCKET_TYPE_DECNET\fR |
---|
56 | DECnet socket. |
---|
57 | |
---|
58 | .TP |
---|
59 | \fBROAR_SOCKET_TYPE_FORK\fR |
---|
60 | This is to fork a roard to communicate with. Can't be use to listen on, just to connect to. |
---|
61 | \fBhost\fR and \fBport\fR is ignored at the moment. |
---|
62 | |
---|
63 | .TP |
---|
64 | \fBROAR_SOCKET_TYPE_FILE\fR |
---|
65 | This is used to open a plain file. Can't be use to listen on, just to connect to. |
---|
66 | \fBhost\fR is the filename to connect to. |
---|
67 | |
---|
68 | |
---|
69 | .SH "RETURN VALUE" |
---|
70 | On success these calls return filehandle. On error, \-1 is returned. |
---|
71 | |
---|
72 | .SH "BUGS" |
---|
73 | Listening on UDP sockets is not supported at the moment. |
---|
74 | |
---|
75 | .SH "EXAMPLES" |
---|
76 | FIXME |
---|
77 | |
---|
78 | .SH "SEE ALSO" |
---|
79 | \fBaccept\fR(2), |
---|
80 | \fBlibroar\fR(7), |
---|
81 | \fBRoarAudio\fR(7). |
---|
82 | |
---|
83 | .\" ll |
---|