Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (1) {
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- FD_SET(sfd, &rfds);
- send_field(cl, pl_num);
- for (it = cl.begin(); it != cl.end(); ++it) {
- FD_SET(it->fd, &rfds);
- /* wbuf - буфер на запись, msg - список сообщений */
- if (it->wbuf.get_len() > 0 || it->msg.size()) {
- FD_SET(it->fd, &wfds);
- }
- }
- gettimeofday(&rt, NULL);
- cur = rt;
- dif = tact - cur;
- if (dif < Time(0, 0)) {
- timeout = Time(0, 0);
- } else {
- timeout = dif;
- }
- res = select(FD_SETSIZE, &rfds, &wfds, NULL, &timeout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement