Changeset 342:30e5d08c39fd in roaraudio for libroaryiff
- Timestamp:
- 07/29/08 22:23:11 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroaryiff/connection.c
r339 r342 4 4 5 5 YConnection *YOpenConnection (const char *start_arg, const char *con_arg) { 6 YConnection * con = malloc(sizeof(YConnection)); 6 YConnection * ycon = malloc(sizeof(YConnection)); 7 struct roar_connection con; 8 char * server = (char *)con_arg; 9 char * name = "libroaryiff client"; 7 10 8 memset( con, 0, sizeof(YConnection));11 memset(ycon, 0, sizeof(YConnection)); 9 12 10 return con; 13 // there is no symbolic value for default con_arg 14 // in the heder files. So we use a hard coded value from the docs 15 16 if ( strcmp(server, "127.0.0.1:9433") == 0 || 17 strcmp(server, "127.0.0.1") == 0 || // \\ // 18 strcmp(server, "localhost") == 0 || // => Don't know if this is valid for libY // 19 strcmp(server, "localhost:9433") == 0 ) { // // but we support it. // 20 21 server = NULL; // try default locations 22 } 23 24 if (roar_simple_connect(&con, server, name) == -1) { 25 // Handle start_arg here! 26 free(ycon); 27 return NULL; 28 } 29 30 ycon->fd = con.fh; 31 32 return ycon; 11 33 } 12 34 … … 15 37 return; 16 38 39 roar_simple_close(connection->fd); // roard will clean up all other sockets if the close the main one. 40 41 42 free(connection); 17 43 } 18 44
Note: See TracChangeset
for help on using the changeset viewer.