-
Networking
I have some experience using the Socket class and ServerSocket class in the java.net package.
However, I want to be able to connect to my Server using a domain name instead of having to know the IP of the server.
Right now of course I just tell my client to connect to 127.0.0.1 but I'd like to be able to have clients connect to the server without having to know my exact IP. Using a domain name or my computer name?
Anyone have ideas?
Also, when creating a chat program using the aforementioned classes, if your server recieves multiple requests from various clients would you create a separate socket for each client to talk to the server or could you use threads to let multiple clients use one socket, one port?
The help is very much appreciated.
-
A question: how do you have a server that doesn't have a domain name?
If your client connects to your server via: localhost ie 127.0.0.1 they are NOT on the internet, they are purely local. Could you explain this?
Or is your server a personal one that you run on your computer which connects to the net via dialup and gets a unique IP address every time you connect?
There are IP lookup routines that will look in the DNS tables and return the domain address for an IP address. Try google.
-
Ok I phrased my question poorly.
1) I want to create a server program in Java
2) have clients connect to that server
What are the options available for them to connect if the server program is running on my computer?
Must they know my IP or is it possible they can use my computer name or something of the like?
-
What kind of connection do you have with the internet? Do you have the same IP address everytime or does it change like with dial-up connections?
If its constant, there might be a "domain-name" associated with it.
I use the following site to translate IP addresses to "domain/text" addresses:
http://www.zoneedit.com/lookup.html
Otherwise your users would type in something like: http://164.34.234.25
which may be shorter than the IP address
If you get a new IP address everytime, that makes it harder. One way to fiddle it would be to get a fixed site that you can place some HTML page on. Have that page do a redirect to your current site. You would have to update it every time that you connected with a new IP address so it would redirect to your new address.
Similar Threads
-
Replies: 15
Last Post: 07-31-2002, 10:56 AM
-
Replies: 1
Last Post: 10-12-2000, 04:35 PM
-
By Paul Clapham in forum VB Classic
Replies: 6
Last Post: 06-20-2000, 02:15 PM
-
By Paul Clapham in forum VB Classic
Replies: 0
Last Post: 06-19-2000, 06:20 PM
-
By Trevor in forum VB Classic
Replies: 0
Last Post: 03-16-2000, 02:53 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|