PDA

View Full Version : client trying to find server


ramollari
Nov16-04, 12:30 PM
I'm trying to build a client-server networking application (in Java). There is a central server program (multithreaded, to handle multiple clients) and the client program. I don't know how the client is going to find the server. Does the user of the client program have to enter the IP address? What if the IP address is dynamic?

NoTime
Nov16-04, 09:28 PM
The client would have to enter the IP unless the IP is provided through DNIS, in which case you could use the server name. The same open call handles both forms.
Servers rarely use dynamic IPs. Lots of game playing if you do.
You also need to know the port the server is listening on.

ramollari
Nov17-04, 02:39 AM
You also need to know the port the server is listening on.
Yes you're right, although the port number of the server application can remain fixed and can be coded as a constant in the program.