i got an Error 40006.. when trying to sendata using winsock could anyone tell me what it is all about ?
Printable View
i got an Error 40006.. when trying to sendata using winsock could anyone tell me what it is all about ?
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.