
Visual Basic Winsock senddata problem
Quote:
> I am trying to build a news reader with
Visual Basic > my client connects to my news server and I get messages from the
> server but when ever I try to use senddata I get an invalid protocol
> error, but when I check my protocol it is indeed tcp.... anyone have
> any Ideas'
> Thanks
> James
There are several things that could be causing it.
1. You may have to use the agSwapBytes funtion in the Windows API.
You would use this API on the message you are going to send.
Your news sever could be using a motorola processor and your PC is
more than likely an Intel processor. They somtimes have the bytes in
certian types
of data in reverse order of each other. (hope that makes sense.)
I have had this error my self and this was one solution.
2. Make sure your winsock control isn't in "listen" mode. Check the
"state" property of the winsock control.
If some how you are in "listen" mode you can't send messages.
I mess with winsock controls connecting to UNIX serves all the time...these
are just some of the problems I have encounterd.
Mark.