[Xorp-users] select timeout question

Ben Greear greearb at candelatech.com
Thu Sep 27 14:47:55 PDT 2007


If you pass a timeout of 0 to selector::wait_and_dispatch, it causes select to wait 'forever'.
Is that on purpose or a bug?  If you want to wait for zero time in select, pass a time-val
with all zero values (not 0, which is actually treated as NULL).

     if (timeout == 0 || *timeout == TimeVal::MAXIMUM()) {
	n = ::select(_maxfd + 1,
		     &testfds[SEL_RD_IDX],
		     &testfds[SEL_WR_IDX],
		     &testfds[SEL_EX_IDX],
		     0);
     } else {


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-users mailing list