[Live-devel] Group Sockets select to poll() port
Sergey Kuprienko
demthedj at gmail.com
Wed Jan 22 05:37:46 PST 2014
I've faced problems using live555 to capture many streams per process.
The source is select() calls. It can't accept fd index more than FD_SETSIZE
( 1024 on most distros).
I've made some patches to code and i believe it would be useful
Sorry, if i've choosed wrong way to send a patch, but cannot found right
way to post it on site.
1) GroupsockHelper.cpp :
// Block until the socket is readable (with a 5-second timeout):
#define GROUPSOCK_USES_POLL
#ifndef GROUPSOCK_USES_POLL
fd_set rd_set;
FD_ZERO(&rd_set);
FD_SET((unsigned)sock, &rd_set);
const unsigned numFds = sock+1;
struct timeval timeout;
timeout.tv_sec = 5;
timeout.tv_usec = 0;
int result = select(numFds, &rd_set, NULL, NULL, &timeout);
if (result <= 0) break;
#else
struct pollfd pollFd;
memset(&pollFd,0,sizeof(pollFd));
pollFd.fd = sock;
pollFd.events = POLLIN | POLLERR;
int result = poll(&pollFd, 1, 5000);
if (result < 0 ) break;
#endif
2) I've made poll()-based task scheduler - how can I post it the best way ?
--
Сергей Куприенко
Отдел разработки ПО, "Эф-Эф"
Sergey Kuprienko
Head of software development dpt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140122/92ed5fc7/attachment-0001.html>
More information about the live-devel
mailing list