Changeset 3128:949cdc22e981 in roaraudio


Ignore:
Timestamp:
01/14/10 09:32:35 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

started to move all the global values for listen sockets into a global struct

Location:
roard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • roard/include/roard.h

    r3056 r3128  
    135135#ifdef ROAR_SUPPORT_LISTEN 
    136136int g_listen_socket[ROAR_MAX_LISTEN_SOCKETS]; 
    137 int g_listen_proto[ROAR_MAX_LISTEN_SOCKETS]; 
     137//int g_listen_proto[ROAR_MAX_LISTEN_SOCKETS]; 
     138struct { 
     139 int socket; 
     140 int proto; 
     141 union { 
     142  void * vp; 
     143  int    si; 
     144  struct { 
     145   int                    dir; 
     146   struct roar_audio_info info; 
     147  } stpl; 
     148 } inst; 
     149} g_listen[ROAR_MAX_LISTEN_SOCKETS]; 
    138150#endif 
    139151 
  • roard/network.c

    r2820 r3128  
    6565   if ( g_listen_socket[i] != -1 ) { 
    6666    if ( FD_ISSET(g_listen_socket[i], &sl) ) { 
    67      if ( net_get_new_client(g_listen_socket[i], g_listen_proto[i]) == -1 ) 
     67     if ( net_get_new_client(g_listen_socket[i], g_listen[i].proto) == -1 ) 
    6868      return -1; 
    6969    } 
  • roard/roard.c

    r3127 r3128  
    269269 int i; 
    270270 
     271 memset(g_listen, 0, sizeof(g_listen)); 
     272 
    271273 for (i = 0; i < ROAR_MAX_LISTEN_SOCKETS; i++) { 
    272274  g_listen_socket[i] = -1; 
    273   g_listen_proto[i]  = ROAR_PROTO_ROARAUDIO; 
     275  g_listen[i].proto  = ROAR_PROTO_ROARAUDIO; 
    274276  server[i]          = NULL; 
    275277 } 
     
    303305   return -1; 
    304306 
    305   g_listen_proto[sockid] = proto; 
     307  g_listen[sockid].proto = proto; 
    306308 
    307309  ROAR_DBG("add_listen(*): proto=0x%.4x", proto); 
Note: See TracChangeset for help on using the changeset viewer.