Created
June 5, 2017 04:31
-
-
Save cuiwm/d0e99bf2ad36798d8efa7808ed600fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check whether the peer has close the socket connection | |
//netstat -antp check the rev message queue | |
struct pollfd pfd[1]; | |
pfd[0].fd = socket_fd; | |
pfd[0].events = POLLRDHUP; | |
int ret = poll(pfd, 1, 0); | |
if (ret > 0) { | |
LG_DBG("poll detect RDHUP ret:%d", ret); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment