Connecting with a computer outside of my LAN

Hi. I have already created a multi-client server that accepts incoming connections from a client program on my LAN. I was wondering how I would modify the client side of the program to connect to a server that is not on my LAN. (ex. you are running the server program on your computer, how do I connect to it with my client program?)

I know that if a person running the server program is behind a NAT, I will need to know their actual IP and they will have to configure their router to port forward. I will then need to use the IP along with the port number that they used to forward with in order to connect with them.
But I don't know how to use that to connect with them in my code. Currently, the client needs to specify the IP address of the person running the server and then I use:
InetAddress.getByName(ipAddress); //ipAddress is the string that they entered for the IP address ex) 192.168.1.1.
When I try using the actual IP address along with the port number they specified, it doesn't seem to work.
InetAddress.getByName(ipAddress); // ex) 68.456.89.23:2000
What do I need to modify or change in order to get this to work?

Similar Messages

  • I have an account for apple but this is not acceptable for i cloud. It say it is correct ID and password but this is not icloud account. So my phone can not connect with my computer and not synchronization too

    I have an account for apple but this is not acceptable for i cloud. It say it is correct ID and password but this is not icloud account. So my phone can not connect with my computer and not synchronization too. Last a few months i have not use this phone. Just i start to use again. So most probably i gave my old mail address as a ID or password. So how can i clearing this subject. regards

    ErolSinan wrote:
    ... there is no button for update between the About and Usage buttons in the General. ...
    Correct. That is only a feature of iOS 5 or later...
    ErolSinan wrote:
    ... yes my phone is 3G.
    then it can only go as far as iOS 4.2.1

  • How can i get my printer to connect with my computer to print?

    I have a HP photosmart prem-web C309n-s printer. I have two different computers. One is a 4 year old HP laptop, and I just recently purchased an HP touchsmart 320 PC. I installed the printer when I first got this computer, and the printing worked fine from any computer that was in the house. Now, it seems that my printer is not connected with my computer. With my dad's laptop in the house, he had before installed the printer, and when I look up the network on my printer, the only computer that it shows connection with is his. I need to print things for class, and I'm not sure how to make my desktop "visible" to my printer. Please help!!!!

    In the Print dialog box choose "Scale To Fit"

  • I recently updated my ipad and then  I connected with my computer forn sync, not realising that I had a new version of itunes with none of my apps. Now I have lost allof the apps and books etc, that I had prurchased. How do I get them back?

    I recently updated my ipad and then  I connected with my computer for sync, not realising that I had a new version of itunes with none of my apps. Now I have lost all of the apps and books etc, that I had prurchased. How do I get them back?

    As long as the apps and ibooks are still available in the store, and you use the same iTunes account as you originally used to buy them, then you should be able to re-download them for free : http://support.apple.com/kb/HT2519

  • WIFI and mobile data connections not connecting with any other outside WIFI networks. Bluetooth not working in car. Any solution?

    After installed iOS7 I am facing the following two problems:
    1. WIFI as well as mobile data connection are working fine at my home. But, not connecting with any other outside WIFI networks. Error message is 'unable to join network'. Mobile data also not connected outside my home. Sometimes wifi and mobile data connect outside my home when I turn off and on the phone.
    2. Bluetooth, in my car, paires well and incoming and out going calls can be received and made. The problem is no sound out put from speakers.
    Apple please make note of the above problems (of million people) and give solution before giving any other updations for painting and tinkering the screens.

    Check this thread, the same solution might work for you:
    http://discussions.nokia.com/t5/Nseries-and-Symbia​n-Smartphones/N8-111-040-1511-Wifi-and-mobiledata-​...

  • HT1549 I don't want other computers connect with my computer, I don't want sharing my macbook pro, so how I can protect my computer and avoid other people connect with my computers

    I don't want other computers connect with my computer, I don't want sharing my macbook pro, so how I can protect my computer and avoid other people connect with my computers

    As long as you do not enable Sharing of any kind (System Preferences > Sharing) no other computer can connect with yours. Also make sure you have your wireless network protected with a WPA2 password.
    That's all I can suggest without knowing what OS version you are running (you are not running iOS as that is for iDevices).

  • Any suggestions on how to get wifi to work?  I have a multitech router and can connect with a computer wirelessly but not the ipad.

    Any suggestions on how to get wifi to work?  I have a multitech router and can connect with a computer wirelessly but not the ipad.

    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398

  • I can not get my Ipod to connect with my computer using a usb cord

    I can not get my Ipod to connect with my computer using my usb cord ?

    Hi starhalcomb,
    I'm sorry to hear you are having issues with your iPod touch. I also apologize, I'm a bit unclear on your exact configuration. If you are having issues with your iPod touch not being recognized in iTunes when you connect via USB, you may find the information and troubleshooting steps outlined in one of the following articles helpful:
    iPhone, iPad, or iPod not recognized in iTunes for Windows - Apple Support
    If you don't see your connected device in iTunes for Mac - Apple Support
    Regards,
    - Brenden

  • My iPhone won't connect with my computer or charge. How can I fix this?

    My iPhone won't connect with my computer. It also will not charge. I changed the white charging cord, but I have the same problem. I connected other devices to the USB and they work. It's strictly the iPhone.
    How can I correct this?

    I forgot to mention, the iPhone does charge via wall plug.

  • Hallo ladies and gentleman, my iPod nano (6 Gen.) has been stolen, is there any chance to find it, in case it is connected with a computer?t

    Hallo ladies and gentleman, my iPod nano (6. Gen.) has been stolen, is there any chance to find it, in case it is connected with a computer?
    serial number is: DC*******DW6
    <Edited By Host>

    call them, tell them you NEED a new battery installed, and they need to tell you when they can do it.  That is their job to help you! Give pushback if necessary.

  • When I connect with my computer, I see the I-phone in I-tunes, but not in Windows Explorer?

    I connect my I-phone with my computer. In I-tunes the phone is there, but not s a removable device in Windows Explorer. It should be recognised I assume. Who knows the answer? Thanks in advance.
    Arend from Holland

    So what sync settings do you currently have enabled from under the iPod's Summary and Music tabs?  Any error messages when you try to sync?
    To be sure, reset sync warnings. To do this, right->click the iPod under Devices and choose Reset Warnings. Then resync your iPod.
    B-rock

  • Facing problem of not getting Bluetooth periferal device to connect with my computer windows 7 on Del studio 1555 model

    I am facing problem for connecting with my windows 7
    My blackberry Q10 not conecting properly,elerts displaying on computer you have not Bluetooth Periferal device driver
    installed,I am not getting same on internet searching

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial printer. You can do this at http://h30499.www3.hp.com/hpeb/
    I hope this helps.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • I recently updated my MacBook Pro to the new software, and now my iMessage and my FaceTime are not connected with my computer. How do I get them to match so that I would be able to use my cellphone number?

    I recently updated my MacBook Pro to the new software, and now my iMessage and my FaceTime are not connected with my phone number like it is supposed to be. How do I get them to match so that I would be able to use my cellphone number on my notebook?

    To reset any OS X program just go to the folder and trash the affected files.
    Open a new Finder Window
    Click "Go" in the above status bar
    Click and HOLD the "option/alt" key and you will see "Library" now show in the above list
    Click Library while still holding the option/alt key and a new window will open with all of your system files
    Go to the preference file (NOT Preference Panes)
    Locate a file named <com.apple.FaceTime.bag.plist>
    Locate another file named <com.apple.FaceTime.plist>
    Locate the file <com.apple.iMessage.bag.plist>
    Drag the files to the trash
    Delete the trash
    Close FaceTime and iMessage if not already closed
    Relaunch FaceTime and iMessage from Applications folder
    This should reset the program back to default. You will have to put your information back into the program but it should work.
    Good Luck.

  • HT4235 my i phone cant connect with my computer

    my i phone cant connect with my computer

    Hello birenkumar,
    I understand that your iPhone is not recognized by iTunes. The following article may help to resolve your issue:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Thanks,
    Matt M.

  • No wireless connection with this computer

    I have got a strange problem. I cannot connect with AirPort via my Router to the Internet. So I spent 1hr with the Apple Telephone Support but with no success. I have tried the following:
    Connecting via Ethernet cable to Router: OK
    Connecting PowerBokk 12" via Airport to Router: OK
    Connecting actual MacBookPro to wireless Network in Apple-Shop: OK
    Connecting actual MacBookPro via Airport to Router: FAIL
    It seems that every single device is ok but I still cannot connect as I like
    Any suggestions or ideas?
    Router: Belkin F5D7630-4A wireless Router 802.11 b/g with Ethernet-Ports
    OS: 10.4.9 with all current updates
    MacBookPro 17"   Mac OS X (10.4.9)  

    Let's first double-check your MacBook Pro's AirPort settings...
    System Preferences > Network > Show > Network Port Configurations
    - Verify that AirPort is "On" (checked)
    - Verify that AirPort is at the top of the list. If it isn't, you can drag it to the top.
    Systems Preferences > Network > Show > AirPort
    AirPort tab
    - By default, join: Automatic
    TCP/IP tab
    - Configure IPv4: Using DHCP
    - Configure IPv6: Automatically or Off
    Proxies tab
    - Configure Proxies: Manually
    - Select a proxy server to configure: <All proxies should be unchecked unless you specifically require a proxy for Internet access.>
    - Exclude simple hostnames (unchecked)
    - Bypass proxy settings for these Hosts & Domains: <leave blank>
    - Use Passive FTP Mode (PASV) (checked)
    If these settings are correct, and you still cannot connect wirelessly, try (temporarily) disabling any wireless encryption (WEP or WPA), and then, try connecting again.

Maybe you are looking for

  • Pre-execute is taking forever

    I have put all the fact packages in one master package and this packages has lot of lookups to join with dimension key. When I try to execute this package this master package it takes forever to start execution and in progress tab I can see that pre-

  • Type of Program

    Dear All WE have a Z Table with 3 primary keys. The data for this table comes from a Legancy System in a File. We need to upload the Data from this File into the Z Table. We are planning to design Z program to does the data upload that will run in bo

  • Insert Initial Fill of New Aggregates

    Hi Experts, good morning............. In Infocube I  created Aggregates it's working fine, I include Process chain in Aggregate Rollup......(Process Types) Drag and Drop Insert Initial Fill of New Aggregates asking Initial Fill__________, Then I sele

  • Painfully obvious ?

    Hi all, Problem: I have an application that 99% works under Webstart, no probs from commandline.. the idea is it arrives and starts under Webstart from there is then downloads other .jar files which are unknown at runtime (else id have them in the jn

  • Flash Player fails to update from Download Center

    I have been trying, with no success, to install the latest version of Flash Player on my PC. When I am directed to the Download Center, it is a blank page, minus the header for Adobe Flash Player. This is extemely frustrating. My PC had operated just