Web Hosting a "Server"

This is not for a game, but somebody may know how to make it work.



I'm writing a chat application (as a test for understanding network communication in Java). I have a program which creates several threads that listen for connections on a particular port (10000) and, when one is received, creates another thread to process the information from the Socket.



I need to host this on the internet! GoDaddy claims to support Java, but they aren't being very helpful… Where can I host this application? It is not a Servlet or JSP. It's just a regular Java application (deployable as a Jar) that can run on any computer, which is why it SHOULD be able to run on a web server, but I can't figure out how to do it.



Does anybody have a web host they'd suggest or an explanation of how to deploy the Java app on GoDaddy?

if they give you any sort of shell access, you can try running it by

./MyApplication.jar





which of course leads us to this, did you remember to:

chmod +x MyApplication.jar

Well, and maybe the limited upstream is another problem.

Trussell said:

I'm writing a chat application (as a test for understanding network communication in Java).

Yeah, you CAN do that... if you want to leave your computer running 24/7 and always have that application hosted on it, eating up your memory.


Dude, u said this is not for a game and for your own educational purposes anyways, so you DON'T have to keep it running 24/7 :). And you can control it from remote via ssh. Better yet, with FreeNX on linux and remote desktop on Windows.

That's how I did it. I had server pc 200 kilometers from my dorm in my farm house and when I needed to start the server I just connected to the servers FreeNX server(that was running on Kubuntu) with FreeNX client that was running on my laptops WinXP. And I was running Eclipse in the server (P4, 512MB ram) through FreeNX. NB! I did not have a static IP, so I had another program sending a http request to a php page to update the ip every 5 minutes just in case it should change.

And I don't think limited upstream is a problem if you are just doing this to understand networking in Java. In my app, I did not build my networking stuff from the scratch, I used JGN instead, I only tested with 2-3 clients on different locations. My servers uplink is only 256kb/s. But I must say that the JGN's performance was outstanding, but sometimes the server did not properly receive the players unregistering message and I never managed to solve that issue. Gonna get to it some time later.

can you run your game on a server?

i thougt i just post it here and that i not make a new topic

I'm not sure I understand your question. Most games have a Server component that helps with communication between clients.

Trussel you can also make your own server. All you need is open ports, provided by your internet service provider. And then you need to forward a specific port from your router to the pc where your java server app is running.



But if this is too difficult for you, you can just test your stuff with localhost and make multiple clients on the same machine where server is running.

Yeah, you CAN do that… if you want to leave your computer running 24/7 and always have that application hosted on it, eating up your memory.

Henri said:

That's how I did it. I had server pc 200 kilometers from my dorm in my farm house and when I needed to start the server I just connected to the servers FreeNX server(that was running on Kubuntu) with FreeNX client that was running on my laptops WinXP. And I was running Eclipse in the server (P4, 512MB ram) through FreeNX. NB! I did not have a static IP, so I had another program sending a http request to a php page to update the ip every 5 minutes just in case it should change.


For everyone else out there that doesn't feel like doing something totally roundabout, there's DynDNS ( http://dyndns.org ).. A good deal of routers will even update the service automatically for you ;)

I too have my own server running off my home line (which is dynamic, to keep the IP updated I use the free services of zoneedit.com). Despite the limited upstream (it's 500-700 kbs if I recall), it's pretty good for development purposes, though these days I use it more for a private SVN for all my projects.



I used to use freeNX but every so often it would fail on me (get only a blank screen), though it was nice - it was essentially like window's remote login, you see the desktop and everything in real time. I've since strayed away from that and just use FTP/SSH if I need to change settings, fix something, or upload.

It's for a commercial application I'm developing  :smiley: so limited upstream is actually a problem :stuck_out_tongue:

Trussell said:

This is not for a game, but somebody may know how to make it work.

I'm writing a chat application (as a test for understanding network communication in Java).



How can such test be commercial application?  :D

That was a test just to be sure that I could run the java app on a webserver :smiley:

Ok, so did you find a solution to your problem?

hi, sometime ago I faced a similar challenge for a academic project: I had implemented a small game with a java udp and tcp-based server, but the teacher demanded that the server MUST be deployable within a J2EE web server, so, the game server starts and shut-down at the same time that the web server, and even be managed from the web side.

So… the solucion then was to deploy a servlet, whose only purpose was to create a new java thread in his load method, and start the game server there. I must warn you that this is not the most professional way to do it, because JEE philosophy is NOT to use threads, but let the web container do it for you. anyway, in my tests things works smoothly, and even we were able to use the servlet to create a basic administration page, so we can query and manage the game server from the web. that was a bonus :slight_smile:



I think this solution is good for testing in environments where you don't have full access to the server, like hosted sites. 

I haven't gotten any solution that works yet, simply because I haven't been willing to fork out the money for a Java-capable webserver yet.

How much does a Java-capable webserver cost? Can you point me to any?

it's usually an extra $20-30 on top of any hosting fees

Tx, but what is that I actually need? I mean like in my personal small-bandwith server I used FreeNX remote desktop to start my gameserver from remote location and I used port-forwarding in my router, but I have no idea how it would be like if I paid to some company for similar service.



Somebody here mentioned Servlets and J2EE. I don't have any experience with these and I don't quite understand what they are.



Could somebody recommend some companies that sell Java-capable webserver service?

where jME's site was hosted until last week definitely offered the Java functionality, I think it was an extra $24 USD a month http://lunarpages.com