All pastes #103 Raw Edit

Anonymous

public text v1 · immutable
#103 ·published 2004-04-21 04:09 UTC
rendered paste body
while(1) {
  int maxfd = 0;
  FD_ZERO(&fds);
  tmp = skinnylist_head;
  while(tmp) {
    FD_SET(tmp->fd, &fds);
    if(tmp->fd > maxfd)
      maxfd = tmp->fd;
    tmp = tmp->next;
  }
  res = ast_select(maxfd + 1, &fds, NULL, NULL, NULL);

  if(res > 0) {
    tmp = skinnylist_head;
    while(tmp) {
      if(FD_ISSET(tmp->fd, &fds)) {
        handle_incoming_packet_on(tmp);
      }
    }
  tmp = tmp->next;
}
}