I'm having trouble getting a BCB 6.0 TClientSocket to connect to the internet on a Windows 98SE machine.
I've written the code (on a Windows XP computer) to transmit user registration information to my website. It uses a TClientSocket to connect to www.ducksnm.com
, and then uses a TWinSocketStream to transmit the information and receive a reply. On the Windows XP computers, this works fine. On the Windows 98SE computer, I get a messagebox saying "Windows socket error (10049) on API 'connect.' " Other people have had similar problems, but the answers on EE and the Usenet have not been helpful.
Here's what I've found:
On the Windows 98SE computer, the error is occurring during or after the TClientSocket's OnConnecting event (when it *supposedly* has looked up the address of the server and before it actually establishes the connection) and before the OnConnect event (It never enters the developer-defined OnConnect function.) It does not trigger the OnError event. The error occurs whether I try to specify the site by setting the Host or the Address property of the TClientSocket.
On the Windows XP computer, I've discovered that:
When I specify the server by setting the Host property of the TClientSocket, the Address property remains blank throughout the connection and transmission. This is interesting because the BCB help says that the OnConnecting event "is the first opportunity to obtain the actual port and IP address of the server endpoint of the connection that is about to form," implying that Address *should* be set sometime during lookup, so that you can read it. Also, when I connect by setting Address and clearing Host, the TClientSocket connects to a DNS server anyway. (Correct me if I'm wrong, but I thought that DNS servers existed to find the IP address associated with a domain name. If the TClientSocket has an IP address and *no domain name*, why is it connecting to a DNS?)
My main $100 question is, is there any reliable solution that will let me connect to the internet and stream information to and from a website on both Windows 98SE and Windows XP? (And presumably everything in between.) The solution could include (preferably free) third-party packages or implementing multiple methods for different operating systems. Or requiring that certain (preferably official Microsoft) free software be installed on the user's computer.