1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-04-15 00:22:35 +00:00

add select to read socket in abyss so we can timeout

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13107 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-04-21 21:43:05 +00:00
parent 377d0b6f2d
commit 373724882c

@ -227,7 +227,19 @@ channelRead(TChannel * const channelP,
struct socketUnix * const socketUnixP = channelP->implP;
int rc;
rc = recv(socketUnixP->fd, buffer, bufferSize, 0);
fd_set rfds, efds;
struct timeval tv = { 10, 0 };
FD_ZERO(&rfds);
FD_ZERO(&efds);
FD_SET(socketUnixP->fd, &rfds);
FD_SET(socketUnixP->fd, &efds);
if ((rc = select(socketUnixP->fd + 1, &rfds, NULL, &efds, &tv)) > 0) {
rc = recv(socketUnixP->fd, buffer, bufferSize, 0);
} else {
rc = -1;
}
if (rc < 0) {
*failedP = TRUE;