bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Socket::isPending () issue


From: Pavel Tsekov
Subject: Socket::isPending () issue
Date: Wed, 20 Feb 2002 15:33:59 +0100

Hello :)

I want to raise another issue witch have made be go crazy for the
last few days :) On unices, based on your system a decision is made
if poll () or select () will be used to check if network data is
available for reading/writing. One would assume that using either of
these will give him the same result - but not. The version of Socket::isPending
() which uses poll () has an additional check - if the return value of
poll is -1 then a check is made if errno is set to EINTR and if
positive poll () is called again. This may result in an infinite loop.

I have a code which sends data through a tcpstream instance. Before
each write I do a Readline() with a timeout of 1000 milliseconds
to see if the other end wants to inform me of something. This seemed
to work fine though if I send a large amount of data (more than 5 Mb)
I got struck buy this issue - at some point the code blocks in the
isPending () and cannot get out of there. I solved the issue by using
the version of isPending () which uses select ().

Now my question is - what's the purpose for this difference in the
behaviour of isPending ().

Thanks ;)

P.S. The system is: i386 runnning RedHat Linux 7.2 - everything is stock, no
installation of custom packages.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]