| 181 | {} |
| 182 | |
| 183 | void SocketSelect::PreSelect() { |
| 184 | xassert2(!IsBreak(), "Already break!"); |
| 185 | FD_ZERO(&readfd_); |
| 186 | FD_ZERO(&writefd_); |
| 187 | FD_ZERO(&exceptionfd_); |
| 188 | |
| 189 | FD_SET(breaker_.BreakerFD(), &readfd_); |
| 190 | FD_SET(breaker_.BreakerFD(), &exceptionfd_); |
| 191 | maxsocket_ = breaker_.BreakerFD(); |
| 192 | errno_ = 0; |
| 193 | } |
| 194 | |
| 195 | int SocketSelect::Select() { |
| 196 | int ret = select(maxsocket_ + 1, &readfd_, &writefd_, &exceptionfd_, NULL); |