Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how run this server over internet

 
Denis Palencia
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help. I want to have my server running on the internet/webhost so people could use it by going through their client program (i don't think it will crash if many go on it because no one knows about it yet) which I will give them and chat and interact. I don't think applets or servlets are necessary just java standalone client program and server.

Hello I am a beginner to java and I am trying to put up a server program on the internet. I figure that I have to put my server on a webhost, run java on it, and run the server program with java interpreter. I dont think that I could run java off servers though because I never heard my host say anything about carrying the java interpreter. When I try to turn on the server by pointing to the CLASS file in the URL of the BROWSER, the browser just asks if I want to download it as a file and doesn't send it to the java interpreter. I have placed my server class files with my html documents. I have a java server and a java client that is not for applets but runs outside browsers.

What do I do? I think I need a computer to run the server program on 24hrs per day / 7days per week. This is my web host awardspace.com.
I also think that my client program can be given to my friends so that we can all access and interact together with the server program.

I got the pair working on my home desktop by running the cmd.exe and writing "java Server" and then opening another cmd.exe for each client "java Client". I opened several clients and shared info but only with myself pretending to be several people/clients.

I have heard that I need to point to a server computer so i put "http://webmaster.awardspace.com" as the ip/name and 4242 as the port all in my client program.
In my server program I just have 4242 as the port in the server socket.

In order to have the server socket listening the server program must be running with the java interpreter right? Or does it start running when client calls? do I have to configure some stuff on my web host? Is the server my desktop or is my web host suitible?

Please help. I want to have my server running on the internet/webhost so people could use it by going through their client program (i don't think it will crash if many go on it because no one knows about it yet) which I will give them and chat and interact. I don't think applets or servlets are necessary just java standalone client program and server.
 
Rusty Shackleford
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if your web host doesn't allow you to run a JVM, you could try compiling the code so it will run natively, or better yet switch hosting companies. If you have the bandwidth and your ISP allows it, you can run your server at home. Although it is not the best idea to use your personal machine for this. An Xbox with linux installed is a cheap solution, but it depends on whether your ISP allows it. Google for hosting companies and java, some only allow Servlets/JSP though.

yes, the server has to be running first, before clients can connect. How you do this depends on your hosting company, probably through a telnet program.

Generally a ServerSocket only needs its port passed to it, but of course clients need both the IP and port.

Only you would know if your server can handle multiple clients, it has to be written to allow it, usually through threads.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're comfortable in Unix, look for a host running Xen or one of the "virtual machine" setups. It's (almost) exactly like having your own server and you can run the JVM and open ports and so on. It all sounds very cool, but way over my head in Unix skills required.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic