-
- i = select(aim_conngetmaxfd()+1, &fds, NULL, &errfds, timeout);
- if (i>=1)
- {
- int j;
- for (j=0;j<AIM_CONN_MAX;j++)
- {
- if (aim_conns[j].fd > -1)
- {
- if ((FD_ISSET(aim_conns[j].fd, &errfds)))
- {
- /* got an exception; close whats left of it up */
- aim_conn_close(&(aim_conns[j]));
- return (struct aim_conn_t *)-1;
- }
- else if ((FD_ISSET(aim_conns[j].fd, &fds)))
- return &(aim_conns[j]); /* return the first waiting struct */
- }
- }
- /* should never get here */