Displaying 2 results from an estimated 2 matches for "poll_timeout".
2013 Jan 03
20
[PATCH] Switch to poll in xenconsoled's io loop.
...lude <termios.h>
@@ -930,7 +930,6 @@ static void handle_log_reload(void)
void handle_io(void)
{
- fd_set readfds, writefds;
int ret;
if (log_hv) {
@@ -959,21 +958,33 @@ void handle_io(void)
for (;;) {
struct domain *d, *n;
- int max_fd = -1;
- struct timeval timeout;
+ int poll_timeout; /* timeout in milliseconds */
struct timespec ts;
long long now, next_timeout = 0;
- FD_ZERO(&readfds);
- FD_ZERO(&writefds);
-
- FD_SET(xs_fileno(xs), &readfds);
- max_fd = MAX(xs_fileno(xs), max_fd);
-
- if (log_hv) {
- FD_SET(xc_evtchn_fd(xce_handle), &readfds);
-...
2012 Oct 12
0
NUT drivers socket polling issues
...lement the poll as { poll(); process(); }*
loop; in pseudo-code:
shut_down = false;
fd_set.init(...);
timeout.set(...);
while (!shut_down) {
status = poll(fd_set, timeout);
switch (status) {
case POLL_ERROR:
// Handle error ...
break;
case POLL_TIMEOUT:
// Handle timeout ...
timeout.set(...);
break;
case POLL_EVENT:
// Handle data ...
break;
}
I.e. you typically have a poll function call (select is used in NUT),
and you process the result of it in a loop.
In driver/m...