PDA

View Full Version : Using Socket Class


Fixzle
07-15-2006, 09:54 AM
This is coding related but the problem I'm having is not explicitly with my code. I'm not sure I can get the answer I need here but maybe somebody with a network/internet background will know how to solve my problem.
Anyways, for a fun little project I decided I wanted to make a simple little chat/IM program. I found the Socket and ServerSocket classes (in Java) and they seem perfect for my purpose. So to understand their functionality I made just a very simple set of programs - a server and client - that should connect. All the server does is print out "I'm connected to (IP address here)." Anyways, my problem is that all my ports that arent blocked to incoming connections are always in use and I can't find a port visible to the world that isn't in use. My guess is that my ISP does this to protect me from malicious intents, but I would like to find a way to get a succesful connection between two computers.

Any advice?

marek_mar
07-16-2006, 01:38 PM
At least the server must be running on a port accesible from outside.

Aradon
07-17-2006, 02:40 PM
My suggestion is that if you can use aim or yim or any of those clients, find out what port it uses (using net stat) and then use that one.

Awesome on the learning to do an IM client, you'll learn a lot! :)

Melon00
07-17-2006, 02:42 PM
Are the server and client programs both on different sets of machines?