Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Server/Client communication over internet in Java
Old 05-16-2011, 08:43 AM Server/Client communication over internet in Java
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Me and a few friends have made a simple game in Java, consisting of a server and a client program (using the Socket and ServerSocket classes). So far, we've only developed and tested locally. That is, we've run both the server and the client on the same machine and connected to localhost, which works just fine.

We now want to try it over the internet but are having troubles. We tried simply having one of us starting up the server at his house and I'm trying to connect from my computer using his IP and some chosen port (54054, so not an occupied port), but we can't connect. It gives a timeout.

Is there any particular steps one should take for these things? We've tried looking at firewalls and opening ports. Is there some kind of settings to allow the JRE to connect to foreign hosts or something? We tried pinging from a console to each other and for some reason I can ping to my friend who has the server but he can't ping to me.

I know this isn't much to go on for you guys, but codewise I'm pretty sure it should work. So I guess I'm just looking for general tips or settings that one often forgets about.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
 
Register now for full access!
Old 05-16-2011, 09:40 AM Re: Server/Client communication over internet in Java
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Open the "listening" port for incoming packets also you will need a port to be open for outgoing packets

For the "ping", your firewall (or your ISP) may be blocking or discarding ICMP packets
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-17-2011, 11:41 AM Re: Server/Client communication over internet in Java
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
We got it working!
We just used another computer and got it working. Seems I didn't get it quite right with my firewall/router :P
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Server/Client communication over internet in Java
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46098 seconds with 12 queries