Re: recv() hang

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



"naveen gupta" <gupta.naveen16@xxxxxxxxx> wrote in message
news:a320d2b3-aedc-4554-b479-ecff4017af98@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i did not used WSAGetLastError bcoz select() is continusly returning
-1

Look at http://msdn.microsoft.com/en-us/library/ms740141(VS.85).aspx . It
says the following: "The select function returns the total number of socket
handles that are ready and contained in the fd_set structures, zero if the
time limit expired, or SOCKET_ERROR if an error occurred. If the return
value is SOCKET_ERROR, WSAGetLastError can be used to retrieve a specific
error code.". If I recall corretly, SOCKET_ERROR is exactly -1, so why don't
you want to get extended error information?

and if there is problem in select() then data should not be
received continusly

Documentation clearly states that if select(...) is successfull it should
return something not equal to -1. So I suggest you the following:

1. Read documentation with attention
2. Check return values of functions
3. If possible, post your code snipped here, we are not telepates, sorry.

--
Volodymyr M. Shcherbyna, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no
rights)


.



Relevant Pages

  • Re: sockets -- basic udp client
    ... print "Received from server: %s" % buf ... default for timeout is no timeout, or block forever, your question: ... a time out on the socket, and you receive no data and the timeout ... of detecting a zero length datagram as transmitted ...
    (comp.lang.python)
  • Re: Socket.Disconnect Method
    ... Although the exception list in the MSDN documentation ... Windows XP SP2. ... An error occurred when attempting to access the socket. ... use the SocketException.ErrorCode property to obtain the specific error code. ...
    (microsoft.public.vsnet.general)
  • RE: GetQueuedCompletionStatus - ReadFile - closed socket
    ... This is msdn recv documentation: ... " If the connection has been gracefully closed, ... socket notification. ... We issue asynchronous read operations on a socket with "ReadFile" and get ...
    (microsoft.public.win32.programmer.networks)
  • Re: Setting based 1 Arrays
    ... Generally I don't have documentation from last century on my PC so no I have no read it. ... some other areas of vb6 are most definately 1 based. ... Which areas are 1 based and which are zero based appears to be random. ... I probably would not have used it in our WCVB.BAS header interface file because it has the explicit lower and upper range defined for the arrays field we have. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Socket read() call returns zero on a transient error
    ... In case my read call returns zero, ... close the socket connection with the server. ... Is there some better way to know that the socket connection at the ... > test for the EINTR or EAGAIN codes. ...
    (comp.unix.programmer)