Re: recv blocks although socket is ready

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Because this is a cross plattform application for AIX, Darwin, FreeBSD,
IRIX, IRIX64, Linux, OSF1, SunOS and Windows. I doesnt' make sense to
change something which works on all other plattforms and which ought to
work on Windows too. I'd rather like to know if this is a known issue
with blocking sockets, select and receive. If so I'd implement a
temporary fix until the issue is being addressed. If not, well I guess
I'm on my own ;-)

Michael

Alexander Nickolov wrote:
Why don't you make your socket non-blocking? Then
you'd get WSAEWOULDBLOCK which you can ignore.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

<314.michael@xxxxxxxxx> wrote in message
news:1163184119.063002.123900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a strange problem using select() and recv(). Intermittedly it
occurs, that even though select() reports the socket to be readable the
following call to recv() blocks. When I shutdown the other peer of the
connection recv() returns and WSAGetLastError() returns WSAESHUTDOWN.
This only occures on our Dell Workstation PWS670. I couldn't reproduce
it on a different machine. I replaced the NIC with a different modell
from a different vendor and installed a different driver but the
problem persited. Running the same app on the same hardware under Linux
I was not able to reproduce the problem though.

Another point which seems worth noting is, that the problem occurs more
frequently when there is some UDP traffic on another socket. This
traffic is consumed by another thread in my app which isn't affected by
the blocking of the main thread.

My setup:
- Dell Workstation PWS670 4xXeon 3.6GHz, 3GB RAM,
- Intel(R) PRO/1000 MTW NIC or ProG-2000S (with Realtek driver)
- Windows XP SP2 (almost) fully patched

Any ideas?

Thanks,
Michael


.



Relevant Pages

  • Re: General Linux c programming questions
    ... controller in c, and Windows programming experience. ... Linux process overhead is only a fraction of what it is under Windows. ... If by sockets you are referring to networking sockets, no special libraries are required. ... Socket API is included in the standard C library. ...
    (comp.os.linux.misc)
  • Re: Where do I start?
    ... > I am a newcomer to Linux development, ... > the database or server scripts into the served html pages. ... Well how would you do these tasks on Windows??? ... & 2) Just like on windows, use socket calls. ...
    (comp.os.linux.development.apps)
  • RE: odd perl & linux socket query problem.....
    ... > use Socket; ... > LINE I'M HAVING PROBLEMS WITH IN LINUX BEING SENT ... "\x01\x01\x01" to a my windows machine through a socket, ... perldoc perldata ...
    (perl.beginners)
  • Re: A C unix server with a windows client
    ... i have written i simple C server with Socket under linux. ... problem with a unix client, but if the client is written in C under ... I believe that sockets under Windows are significantly different from ...
    (comp.lang.c)
  • Re: Future of IT in Lebanon
    ... working knowledge of Indian programmers DNA, nor of their intuitive Java ... > So Longhorn is not an experiment and Linux is an experiment? ... another chapter in the Windows story, and the Microsoft marketing machine is ... > application opens, Check the about, it says Microsoft Visual Basic 6.3. ...
    (soc.culture.lebanon)