Summary:
- I love unix.
Reviewed By: mcslee
Test Plan: boz will test it
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665125
13f79535-47bb-0310-9956-
ffa450edef68
fd_set fds;
+ int maxEintrs = 5;
+ int numEintrs = 0;
+
while (true) {
FD_ZERO(&fds);
FD_SET(serverSocket_, &fds);
int ret = select(serverSocket_+1, &fds, NULL, NULL, NULL);
if (ret < 0) {
+ // error cases
+ if (error == EINTR && (numEintrs++ < maxEintrs)) {
+ // EINTR needs to be handled manually and we can tolerate
+ // a certain number
+ continue;
+ }
perror("TServerSocket::acceptImpl() select -1");
throw TTransportException(TTransportException::UNKNOWN);
} else if (ret > 0) {
if (recvTimeout_ > 0) {
client->setRecvTimeout(recvTimeout_);
}
-
+
return client;
}