source: roaraudio/include/libroar/socket.h @ 374:e3f42f05cdfb

Last change on this file since 374:e3f42f05cdfb was 374:e3f42f05cdfb, checked in by phi, 16 years ago

added a function to open an UDP socket

File size: 1.3 KB
Line 
1//libroar.h:
2
3#ifndef _LIBROARSOCKET_H_
4#define _LIBROARSOCKET_H_
5
6#include "libroar.h"
7
8#define ROAR_SOCKET_MODE_LISTEN  1
9#define ROAR_SOCKET_MODE_CONNECT 2
10
11#define ROAR_SOCKET_TYPE_NONE 0
12#define ROAR_SOCKET_TYPE_UNKNOWN ROAR_SOCKET_TYPE_NONE
13#define ROAR_SOCKET_TYPE_INET 1
14#define ROAR_SOCKET_TYPE_TCP  ROAR_SOCKET_TYPE_INET
15#define ROAR_SOCKET_TYPE_UNIX 2
16#define ROAR_SOCKET_TYPE_FORK 3
17#define ROAR_SOCKET_TYPE_PIPE ROAR_SOCKET_TYPE_FORK
18#define ROAR_SOCKET_TYPE_FILE 4
19#define ROAR_SOCKET_TYPE_UDP  5
20
21#define ROAR_SOCKET_TYPE_MAX  4
22
23#define ROAR_SOCKET_QUEUE_LEN 8
24
25#define ROAR_SOCKET_BLOCK     1
26#define ROAR_SOCKET_NONBLOCK  2
27
28#define ROAR_SOCKET_MAX_HOSTNAMELEN 64
29
30int roar_socket_listen  (int type, char * host, int port);
31int roar_socket_connect (char * host, int port);
32
33int roar_socket_new_tcp    (void);
34int roar_socket_new_udp    (void);
35int roar_socket_new_unix   (void);
36int roar_socket_open       (int mode, int type, char * host, int port);
37int roar_socket_open_fork  (int mode, char * host, int port);
38int roar_socket_open_file  (int mode, char * host, int port);
39int roar_socket_open_proxy (int mode, int type, char * host, int port, char * proxy_type);
40
41int roar_socket_nonblock(int fh, int state);
42
43int roar_socket_open_socks4a(int mode, int fh, char * host, int port);
44
45#endif
46
47//ll
Note: See TracBrowser for help on using the repository browser.