Hi Debbie,
Lots of things can go wrong with client to server connections, especially in a world full of firewalls and security paranoya.
To find out what's going on, you are generally better off getting the server running first. Assuming that the server is serving up plain text, you can use telnet to connect to it once it is running and test it. Let's say you have your server running on port 1953 and when a client connects, it sends a banner and then waits for a client response. Then the telnet session would go something like this:
telnet localhost 1953
Connection To localhost...
"Greetings from Debbie's server"
...
further communication between client and server
...
Connection lost
Note that you may not be able to see what you type in some implementations of telnet (Microsoft's NT/2000 version in particular) but
you should be able to get most of the bugs out of your server like this.
Next you move on to the client. Try connecting from the localhost first. So in our above example you would create a Socket thus:
Once you get that going, then try connecting from another machine on the same LAN. Finally, you try to connect thru the internet.
Lots of things can happen to prevent your client from connecting to the server, especially from the internet. If your server is behind a firewall, you have to be sure that your service port is passed thru to the local IP where your service is running. If the server is behind a NAT server then you can just about forget ever connecting to it from outside.
Also be sure you use a port above 1024 and make sure that the port you choose does not have some other service already running on it.
Hope his helps,
Michael Morris