Results 1 to 7 of 7
  1. #1
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default Application does not connect over internet.

    Hi,

    I'm making a client TicTacToe application and a server TicTacToe application.
    The server application is to run on my computer the it's IP according to whatismyip.com is 175.110.58.234.
    On the client application, I made a socket which connects to that IP with port 8558.

    I sent the client application to my brother (who lives in a different city) and asked him to connect with my server but it failed to connect.

    Am i using the wrong I.P ? When I used local addresses to test locally on my computer - the client connected to the server successfully.

    Thanks for your help.

  2. #2
    doWhile is online now Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    Make sure you don't have a firewall preventing external access to that port, and make sure your server is running when you attempt it from a remote machine.

  3. #3
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default

    My Firewall was on. I turned it off but the client app was still unable to connect. Server was running at the time.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default

    Have you tried connecting using your IP address from your computer vs using the localhost address?

  5. #5
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default

    Yeah I did try that but that didn't work either which is why I think I might be using the wrong ip.

  6. #6
    doWhile is online now Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    but that didn't work either which is why I think I might be using the wrong ip.
    So you can reproduce the problem on your own computer which is good...I presume the client is throwing an exception? Do you have a stack trace? Is it truly a timeout? How did you distribute the app (webstart, jar, applet - both webstart and applet will have to be signed for them to work)?

  7. #7
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default

    Yup there is an exception, but I didn't find it very helpful. It's just a connectException.

    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    The Application is a Runnable JAR.

Similar Threads

  1. How to authenticate code with no internet connect.
    By beardawg in forum Java Applets
    Replies: 1
    Last Post: 04-14-2010, 07:31 PM
  2. Replies: 0
    Last Post: 04-13-2010, 08:16 PM
  3. internet info in application
    By saurabh.w in forum New To Java
    Replies: 1
    Last Post: 08-16-2009, 12:16 PM
  4. Replies: 3
    Last Post: 09-18-2008, 03:07 PM
  5. Connect Java application to photo editor
    By syellows in forum Advanced Java
    Replies: 1
    Last Post: 11-21-2007, 12:09 AM

Posting Permissions

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