Receive() error 2006

During the execution of client server programming in vc++

i got "Receive() error 2006" in the client side.where i did mistake.




Answer this question

Receive() error 2006

  • ititrx

    What is Receive() Who returns this error What exactly "client server programming" means
  • DavidThi808

    Do you mean that the return value of the Receive() was 2006 or it returns SOCKET_ERROR and the 2006 was the return value of the GetLastError() you called after Receive().
    If the first option, then the Receive() succeeded and the 2006 means the number of bytes received. If the second option, then I think that you didn't call GetLastError() immediately after the Receive(), so I guess that you should call the GetLastError() immediately after the Receive().
    If you still have troubles then send a snippest of your code. Also I suggest sending your question to win32.programmer.networks group:
    http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.win32.programmer.networks


  • Bob Lyden

    Hello

    Re: Receive() error 2006

    I am going to mark this thread as answered since you have not followed up with any further information on your problem - I assume you solved the problem yourself or one of the suggestions in this thread helped you solved the problem. If you have a solution you could post it so others can find it. If you do not have a solution then please submit further details and then mark the thread as unanswered.

    Thanks

    Damien



  • j_johnso

    It is not clear what is client. We cannot guess it is CSocket or CAsyncSocket, since the third argument of Receive does not seems to be appropriate.


  • willajo

    ret = client.Receive(resbody, sizeof(resbody), &receivebytes)

    here ret value is 2006,whats th reason.



  • Receive() error 2006