Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Client Server Java app

 
Greenhorn
Posts: 20
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I developed a client server based java networking Instant Messaging app. The client program is needed to be run on the client computer whereas the server program is on server computer. This works in my local wi-fi network(Home network). But i want this one to deploy on internet using some servers and so,so that my friend who is in another city can run the client program from there. Would it be possible for me to do this? I tried to learn heroku techniques for java but its hard for me to understand.
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your home computer has a public IP, you can still run the server on your machine and your friend can access it.
Else you might want to consider something like http://aws.amazon.com/ec2/
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no particular problem in doing this - the server needs to run on a machine that's accessible to the both of you. Any server obtained from a Java hosting provider should do.
 
sashwat kumar padhy
Greenhorn
Posts: 20
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:If your home computer has a public IP, you can still run the server on your machine and your friend can access it.
Else you might want to consider something like http://aws.amazon.com/ec2/



I found my public ip from this site : http://ip.w69b.com/ Which means my lappy has a public ip right? Then i ran the server program from cmd as usual. And ran the client program on another lappy,changing the ip there,to this public ip. And it didn't work! Should i compile my server program in some different manner like changing ip manually or some stuffs like that?
 
sashwat kumar padhy
Greenhorn
Posts: 20
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:There is no particular problem in doing this - the server needs to run on a machine that's accessible to the both of you. Any server obtained from a Java hosting provider should do.



Well if i host it in a server,then after uploading it to that server how to compile the java program? I mean.using the cmd command prompt from my laptop(I am not familiar with IDEs yet)? In that case what's the significance of uploading it to the server if finally i am gonna compile it in my laptop's cmd command prompt? How to execute the program file on server?
 
author
Posts: 23899
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sashwat kumar padhy wrote:
I found my public ip from this site : http://ip.w69b.com/ Which means my lappy has a public ip right? Then i ran the server program from cmd as usual. And ran the client program on another lappy,changing the ip there,to this public ip. And it didn't work! Should i compile my server program in some different manner like changing ip manually or some stuffs like that?



Not quite. All that means is that your computer has access to the internet -- and the IP address that it is using to access the internet is the one reported from that site.

That IP address may or may not be the IP address of your computer. If it is, then you are golden. It should work, provided that your computer don't has a firewall that protects you from that access.

If you IP address is different from the one being reported, then you are behind some sort of router/firewall. You need administration rights, as you need figure out the path within your intranet that routes your computer to the internet (to that reported address), then you need to configure all those machines along that route, so that when someone hits a port on that IP address of that internet access machine, there is a route to your machine.

Henry
 
Ulf Dittmer
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sashwat kumar padhy wrote:if i host it in a server,then after uploading it to that server how to compile the java program?


The code is generally not built on the server, so you would compile it before uploading.

How to execute the program file on server?


Depends on what kind of server you get. If you get Java web app hosting, then you could start the server from a ServletContextListener (I assume the server opens some specific port to listen). Make sure the hosting supports opening ports. If you get a complete server (or virtual server), then there should be no problem running any Java code as a daemon.
 
sashwat kumar padhy
Greenhorn
Posts: 20
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Depends on what kind of server you get. If you get Java web app hosting, then you could start the server from a ServletContextListener (I assume the server opens some specific port to listen). Make sure the hosting supports opening ports. If you get a complete server (or virtual server), then there should be no problem running any Java code as a daemon.



Actually i am gonna get a free hosting server from http://www.serversfree.com (Haven't got it yet). Could this help in deploying this program?
 
Ulf Dittmer
Rancher
Posts: 43024
76
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see no indication that the service you'd get there supports Java. Generally, Java hosting is not free - you should be prepared to pay the equivalent of $5-10 per month for basic Java hosting.
 
sashwat kumar padhy
Greenhorn
Posts: 20
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I see no indication that the service you'd get there supports Java. Generally, Java hosting is not free - you should be prepared to pay the equivalent of $5-10 per month for basic Java hosting.




Oh kay! Thanks a lot for your concern and support..""
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic