roar_socket_listen3
Opens a new listen socket
Usage
#include <roaraudio.h>
int roar_socket_listen(int type, char * host, int port);
Overview
Opens a new listening socket for network clients to connect to. You may accept new connections via accept(2).
Parameters
type-
The type of the Socket. See the list below.
host-
The host or path name to listen on. This depends on the type argument. For TCP/IP to listen on any interface use a value of "0.0.0.0".
port-
The port number to listen on. This may be ignored by types not supporting port numbers.
Socket types
ROAR_SOCKET_TYPE_UNKNOWN-
The type will be auto detected. Don't use this if you know the type. Only use this to support user given addresses and enable auto detection.
ROAR_SOCKET_TYPE_TCP-
Use a TCP/IP connection. This is standard mode for networking.
hostis the hostname or IP to listen on andportis the port number to use.
ROAR_SOCKET_TYPE_INET-
Same as above but deprecated. Use
ROAR_SOCKET_TYPE_TCP.
ROAR_SOCKET_TYPE_UNIX-
UNIX Domain Socket. This should be default for local connections.
hostis the filename of the socket.
ROAR_SOCKET_TYPE_DECNET-
DECnet socket.
ROAR_SOCKET_TYPE_FORK-
This is to fork a roard to communicate with. Can't be use to listen on, just to connect to.
hostandportis ignored at the moment.
ROAR_SOCKET_TYPE_FILE-
This is used to open a plain file. Can't be use to listen on, just to connect to.
hostis the filename to connect to.
Return value
On success these calls return filehandle. On error, -1 is returned.
Examples
FIXME
Releases
6 releases since Debian 6.0 (Squeeze); the text changed 1 time.