Call both Spdylay::recv and Spdylay::send on either POLLIN or POLLOUT
This commit is contained in:
parent
6904ccc023
commit
3bfe0553d1
|
@ -179,12 +179,13 @@ int communicate(const std::string& host, uint16_t port,
|
||||||
perror("poll");
|
perror("poll");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(((pollfds[0].revents & POLLIN) && sc.recv() != 0) ||
|
if(pollfds[0].revents & (POLLIN | POLLOUT)) {
|
||||||
((pollfds[0].revents & POLLOUT) && sc.send() != 0)) {
|
if(sc.recv() != 0 || sc.send() != 0) {
|
||||||
ok = false;
|
ok = false;
|
||||||
std::cout << "Fatal" << std::endl;
|
std::cout << "Fatal" << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if((pollfds[0].revents & POLLHUP) || (pollfds[0].revents & POLLERR)) {
|
if((pollfds[0].revents & POLLHUP) || (pollfds[0].revents & POLLERR)) {
|
||||||
std::cout << "HUP" << std::endl;
|
std::cout << "HUP" << std::endl;
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
Loading…
Reference in New Issue