Results 1 to 6 of 6
- 10-07-2011, 05:09 AM #1
Member
- Join Date
- May 2010
- Posts
- 23
- Rep Power
- 0
Client/Server app only works on PC within a private network
Hi,
So I made this simple chat application, which consists of a server and a client component. When I run the server part on my PC, and run the client part on another PC connected to the same router in my house, the two parts are able to send and receive messages. But when I send the client component to my friend (who's elsewhere in the city!) to run, it couldn't connect with the server. And we usually get this "Connection timed out" or "Refused connection" exception.
So what could be the problem here?
Thanks!Last edited by oontvoo; 10-07-2011 at 05:15 AM.
- 10-07-2011, 12:53 PM #2
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
Re: Client/Server app only works on PC within a private network
How are you connecting ? By static ip and port?
Your private ip is probably not available outside your lan
You can add exception on you router to transfer all data on port x to your ip
- 10-07-2011, 08:21 PM #3
Member
- Join Date
- May 2010
- Posts
- 23
- Rep Power
- 0
Re: Client/Server app only works on PC within a private network
Yes, I connect via IP and port, but I dont know if my IP is a static one.
HOw do I know if it is a static anyways?
I went only and search for those website that'd give me my current IP. And that's how I got my IP.
- 10-11-2011, 10:21 PM #4
Member
- Join Date
- Jan 2010
- Posts
- 8
- Rep Power
- 0
Re: Client/Server app only works on PC within a private network
Typically you will not have a static IP address if you pay for basic Internet service. However, in most cases, you will always have the same IP unless you turn your router off and your lease on that address expires. It's not reliable for a production environment, but in your case, having a static IP probably doesn't matter. Go into your router's configuration and find port forwarding, forward the port that your server program is using to the machine's local IP. Then all traffic coming to your router on that port will be directed to your server app.
- 10-27-2011, 09:12 PM #5
Re: Client/Server app only works on PC within a private network
I think you need to port forward it.
- 10-28-2011, 12:57 AM #6
Member
- Join Date
- Oct 2011
- Posts
- 65
- Rep Power
- 0
Similar Threads
-
Synchronous client behavior on a network
By burrough in forum NetworkingReplies: 5Last Post: 04-21-2011, 09:22 PM -
server-client; client sends a username to the server.
By lkcz in forum New To JavaReplies: 2Last Post: 09-24-2010, 11:31 AM -
Create Personal Messenger that works on Network or Internet
By vdparaliya in forum NetworkingReplies: 0Last Post: 08-24-2010, 04:39 AM -
Server is in a network using an IP, but router in network carries the external IP(www
By lse123 in forum NetworkingReplies: 7Last Post: 05-02-2010, 10:35 PM -
Datagram Client and Server, client timer question
By saru88 in forum NetworkingReplies: 1Last Post: 10-05-2008, 03:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks