FACT++  1.0
void io_sig_handler ( int  num)

Definition at line 811 of file tcpip.c.

References count, do_accept(), do_read(), fds_get_entry(), get_bytes_to_read(), list_to_fds(), MY_FD_CLR, and Net_conns.

Referenced by dim_tcpip_init().

812 {
813  fd_set rfds;
814  int conn_id, ret, selret, count;
815  struct timeval timeout;
816 
817  if(num){}
818  do
819  {
820  timeout.tv_sec = 0; /* Don't wait, just poll */
821  timeout.tv_usec = 0;
822  list_to_fds( &rfds );
823 #ifdef __linux__
824  selret = poll(Pollfds, Pollfd_size, 0);
825 #else
826  selret = select(FD_SETSIZE, &rfds, NULL, NULL, &timeout);
827 #endif
828  if(selret > 0)
829  {
830  conn_id = 0;
831  while( (ret = fds_get_entry( &rfds, &conn_id )) > 0 )
832  {
833  if( Net_conns[conn_id].reading )
834  {
835  count = 0;
836  do
837  {
838  if(Net_conns[conn_id].channel)
839  {
840  do_read( conn_id );
841  count = get_bytes_to_read(conn_id);
842  }
843  else
844  {
845  count = 0;
846  }
847  }while(count > 0 );
848  }
849  else
850  {
851  do_accept( conn_id );
852  }
853  MY_FD_CLR( (unsigned)Net_conns[conn_id].channel, &rfds );
854  }
855  }
856  }while(selret > 0);
857 }
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
static int get_bytes_to_read(int conn_id)
Definition: tcpip.c:685
static int do_read(int conn_id)
Definition: tcpip.c:705
static int fds_get_entry(fd_set *fds, int *conn_id)
Definition: tcpip.c:570
int count
Definition: db_dim_server.c:18
#define MY_FD_CLR(fd, set)
Definition: tcpip.c:79
void do_accept(int conn_id)
Definition: tcpip.c:765
static int list_to_fds(fd_set *fds)
Definition: tcpip.c:535

+ Here is the call graph for this function:

+ Here is the caller graph for this function: