Results 1 to 6 of 6
  1. #1
    oontvoo is offline Member
    Join Date
    May 2010
    Posts
    23
    Rep Power
    0

    Default 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.

  2. #2
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default 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

  3. #3
    oontvoo is offline Member
    Join Date
    May 2010
    Posts
    23
    Rep Power
    0

    Default 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.

  4. #4
    coiner is offline Member
    Join Date
    Jan 2010
    Posts
    8
    Rep Power
    0

    Default 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.

  5. #5
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default Re: Client/Server app only works on PC within a private network

    I think you need to port forward it.

  6. #6
    Grkn is offline Member
    Join Date
    Oct 2011
    Posts
    65
    Rep Power
    0

    Default Re: Client/Server app only works on PC within a private network

    They are right :)

    You have to do port forwarding from router (Modem)

Similar Threads

  1. Synchronous client behavior on a network
    By burrough in forum Networking
    Replies: 5
    Last Post: 04-21-2011, 09:22 PM
  2. Replies: 2
    Last Post: 09-24-2010, 11:31 AM
  3. Replies: 0
    Last Post: 08-24-2010, 04:39 AM
  4. Replies: 7
    Last Post: 05-02-2010, 10:35 PM
  5. Replies: 1
    Last Post: 10-05-2008, 03:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •