Changeset 75:bca1641a0cd8 in roaraudio
- Timestamp:
- 07/12/08 17:18:37 (16 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/socket.h
r69 r75 12 12 #define ROAR_SOCKET_TYPE_FORK 3 13 13 #define ROAR_SOCKET_TYPE_PIPE ROAR_SOCKET_TYPE_FORK 14 #define ROAR_SOCKET_TYPE_FILE 4 14 15 15 16 #define ROAR_SOCKET_QUEUE_LEN 8 … … 27 28 int roar_socket_open (int mode, int type, char * host, int port); 28 29 int roar_socket_open_fork (int mode, char * host, int port); 30 int roar_socket_open_file (int mode, char * host, int port); 29 31 int roar_socket_open_proxy (int mode, int type, char * host, int port, char * proxy_type); 30 32 -
libroar/socket.c
r71 r75 126 126 } else if ( type == ROAR_SOCKET_TYPE_FORK ) { 127 127 return roar_socket_open_fork(mode, host, port); 128 } else if ( type == ROAR_SOCKET_TYPE_FILE ) { 129 return roar_socket_open_file(mode, host, port); 128 130 } else { 129 131 return -1; … … 178 180 179 181 return -1; 182 } 183 184 int roar_socket_open_file (int mode, char * host, int port) { 185 int fh; 186 187 if ( mode == MODE_LISTEN ) 188 return -1; 189 190 if ( (fh = open(host, O_RDONLY, 0644)) == -1 ) { 191 ROAR_ERR("roar_socket_open_file(*): Can not open file %s: %s", host, strerror(errno)); 192 } 193 194 return fh; 180 195 } 181 196
Note: See TracChangeset
for help on using the changeset viewer.