I've been having a problem with a SocketServer (very similar to the example) app under redhat 6.2 and 7.0, externally it seems that a new connection after the last connection has terminated does not connect, but the next one does.
ie: a first telnet to the served port works (data transfers), and more do until the first (and all others..) have disconnected, then the next connect appears to work, but no data transfer, then the next one works until we drop to zero connections again.
This looks to be a problem with poll being called for zero sockets, and it does not return until the *second* connection attempt is made.
I'm chasing this, but was wondering if anyone had any hints.
Regards,
Stuart.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've implemented a quick 'hack' fix which currently works (but is VERY ugly..) for 1.3.2
in posix/poll.cpp, around line 511, where it reads:
poll( mfd.getList(), count + 1, timer );
I change it to:
if(first)
poll( mfd.getList(), count + 1, timer );
else
sleep(1);
and this at least gets things going (in my app I can live with a max 1second connect delay for the rare problem case.. others may not be able to).
now, I'm sure someone knows a real fix, anyone out there?
Stuart.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been having a problem with a SocketServer (very similar to the example) app under redhat 6.2 and 7.0, externally it seems that a new connection after the last connection has terminated does not connect, but the next one does.
ie: a first telnet to the served port works (data transfers), and more do until the first (and all others..) have disconnected, then the next connect appears to work, but no data transfer, then the next one works until we drop to zero connections again.
This looks to be a problem with poll being called for zero sockets, and it does not return until the *second* connection attempt is made.
I'm chasing this, but was wondering if anyone had any hints.
Regards,
Stuart.
I've implemented a quick 'hack' fix which currently works (but is VERY ugly..) for 1.3.2
in posix/poll.cpp, around line 511, where it reads:
poll( mfd.getList(), count + 1, timer );
I change it to:
if(first)
poll( mfd.getList(), count + 1, timer );
else
sleep(1);
and this at least gets things going (in my app I can live with a max 1second connect delay for the rare problem case.. others may not be able to).
now, I'm sure someone knows a real fix, anyone out there?
Stuart.