Changeset 3253:05670218c1d3 in roaraudio
- Timestamp:
- 01/30/10 13:40:35 (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/include/network.h
r2530 r3253 30 30 int net_check_listen (void); 31 31 32 int net_get_new_client (int sock, int proto); 32 struct roard_listen; 33 34 int net_get_new_client (struct roard_listen * lsock); 33 35 34 36 #endif -
roard/include/roard.h
r3207 r3253 130 130 131 131 #ifdef ROAR_SUPPORT_LISTEN 132 struct {132 struct roard_listen { 133 133 int socket; 134 134 int proto; -
roard/network.c
r3129 r3253 65 65 if ( g_listen[i].socket != -1 ) { 66 66 if ( FD_ISSET(g_listen[i].socket, &sl) ) { 67 if ( net_get_new_client( g_listen[i].socket, g_listen[i].proto) == -1 )67 if ( net_get_new_client(&(g_listen[i])) == -1 ) 68 68 return -1; 69 69 } … … 79 79 80 80 #ifdef _CAN_OPERATE 81 int net_get_new_client ( int sock, int proto) {81 int net_get_new_client (struct roard_listen * lsock) { 82 82 int fh; 83 83 int client; … … 91 91 socklen_t addrlen = sizeof(addr); 92 92 93 fh = accept( sock, (struct sockaddr*)&addr, &addrlen);93 fh = accept(lsock->socket, (struct sockaddr*)&addr, &addrlen); 94 94 95 95 ROAR_DBG("net_get_new_client(void): fh = %i", fh); … … 131 131 } 132 132 133 ROAR_DBG("net_get_new_client(*): proto=0x%.4x", proto);133 ROAR_DBG("net_get_new_client(*): proto=0x%.4x", lsock->proto); 134 134 135 if ( clients_set_proto(client, proto) == -1 ) {136 ROAR_WARN("net_get_new_client(*): Setting proto(0x%.4x) of client %i failed.", proto, client);135 if ( clients_set_proto(client, lsock->proto) == -1 ) { 136 ROAR_WARN("net_get_new_client(*): Setting proto(0x%.4x) of client %i failed.", lsock->proto, client); 137 137 return -1; 138 138 } 139 139 140 switch ( proto) {140 switch (lsock->proto) { 141 141 case ROAR_PROTO_ROARAUDIO: 142 142 // nothing needed to be done here … … 158 158 break; 159 159 #endif 160 case ROAR_PROTO_SIMPLE: 161 break; 160 162 #endif 161 163 default:
Note: See TracChangeset
for help on using the changeset viewer.