CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: winsocks

  1. #1
    Join Date
    Jul 1999
    Posts
    35

    winsocks

    i got an Error 40006.. when trying to sendata using winsock could anyone tell me what it is all about ?


  2. #2

    Re: winsocks

    This message occurs because you are not connected to the remote machine.

    1. If have not already called the connect method, do so.

    2. After calling the connect method, you have to wait until you are actually connected, e.g.,

    winsock1.connect
    do until winsock1.state = sckConnected
    doevents
    loop

    You also need to jump out of the loop in case you are not connected within a specified time frame. There is a code example at http://www.freevbcode.com/ShowCode.Asp?ID=108 that shows you how to do this. Another example there, http://www.freevbcode.com/ShowCode.Asp?ID=137, is a good application to learn about winsock programming in general.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured