How to distinguish the right address to use

We're making a P2P application for audio streaming. It's working, but we have this problem - if one would enter 'localhost' for the server address (because server is indeed on the local machine), this would register that peer by the address value of 127.0.0.1. If for server address a LAN address was entered, this peer would be registered by it's LAN address as well, so noone outside the LAN could address it in order to download music from it. In previous case, with 127.0.0.1, all peers that atempt to get a file from that problematic one would actually try to get the file from themselves (as they would see the target peer's address as '127.0.0.1').
I believe you see my problem here...
Is there a better solution that to ask the client which address they wish to use of all available (global or local)? I could also tell the client that if they specify a LAN address, the program would work in LAN only, and with the loopback the prog would function in a test mode on a local machine only, but I hope someone will come up with a more elegant solution...

...I'm not sure I got you... and I'm not sure you got me.
Accessing the global server is no problem, nor is accessing some other peer... The only problem is when you enter LAN address for global server address, because the server will then put in it's base something like: file "example.mp3" can be found on the address "your LAN address" instead of: file "example.mp3 can be found on the address "your global public IP". So, when anyone tries to get example.mp3 he will search for it on "your LAN address" (and get an error) instead of "your global public IP". Similar thing with 127.0.0.1 for server address.
This does not happen when you enter server's global IP. The data still runs through LAN but the address will be stored properly.
I get the address by socket.getInetAddress(). So, when the peer says the server is on 127.0.0.1, the server resolvers peer's address as 127.0.0.1. Apparently, no problem occurs if the server runs on a separate machine (not within same LAN) from any of the peers.
Sorry if you'd got what I'm saying from the beginning and my rambling was redundant...

Similar Messages

  • Changing the email address iphoto uses?

    can anyone tell me how i change the email address iphoto uses to share??
    thank you

    sorry, the system was down for some time.
    If you are mailing using "iPhoto" you will see mail stationary like this.
    Use the "From" menu to select the account you want to mail from. That will set the default address to the address set in the selected account.
    Use the "Preferences > Accounts" tab to set the default address for your Mail accounts. Click "+" to add an account, if necessary.
    If you'd rather use a different Mail program then iPhoto's stationary, set the menu to "Mail" or your preferred mailer. Then you select the default mail address in the preferences of your mailer.

  • HT1920 I am trying to sign on an old Apple ID through iTunes and it is likely that the email address I used has been closed down. I can not remember the password due to using a new apple ID I frequently use. How else can I retrieve my password or sign in?

    I have an old Apple ID I have been trying to log in to retrieve permission for the songs I have bought for my iTunes. However due to it being an old ID, I have forgotten the password and from what I can remember, the email address I used for security was closed down. I am aware that I can go through security questions and when asked for my D.O.B, I have a feeling I never adjusted my settings in the Apple ID account therefore can not get past that question either.
    Please help!
    Thanks
    Karen

    Hi Kazmania89,
    Welcome to the Support Communities!
    If you require additional assistance with this, click on the link below for guidance:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Once you are able to gain access to the old Apple ID, this article may be helpful:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    I have purchased music, apps, or books with multiple Apple IDs. How can I get all of this content onto my iOS device?

    First, you need to copy all of your purchased content so it is on the same Mac or PC with iTunes. This computer should be the one you sync your device with. For more information on how to move your content, see these articles:
    Mac:  iTunes for Mac: How to copy purchases between computers
    PC:  iTunes for Windows: How to copy purchases between computers
    Next, authorize your computer to play content with each Apple ID in iTunes. Once your computer is authorized for all your content, it can be synced to your iPhone, iPad, or iPod touch. 
    Cheers,
    - Judy

  • HT1349 how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    SfromW wrote: ... how can I change an email for authorization, the email address we used years back, is no longer a valid email address
    How to change account here: http://support.apple.com/kb/PH1641
    If you need more help, start here: http://www.apple.com/support/itunes/
    SfromW wrote: ... we can't remember the password from the old email address (for authorization)...
    Help Retrieving and changing passwords here: http://support.apple.com/kb/HT1911
    If you need more help, from iTunes for Windows, click  iTunes > iTunes Store > Support
    SfromW wrote: ... apple should make it easier to transfer authorization authority....I would think anyways.
    You might want to rethink your thoughts about making transferring authority easier.  Making it too easy would certainly degrade your account's security.  If you still believe it should be easier, you can send feedback directly to Apple via http://www.apple.com/feedback/itunesapp.html
    You will not get a response, but you can be certain that the responsible Apple people will see your input for consideration in FaceTime product development.
    As a new user, please understand that you are NOT directly addressing Apple here.  For more info about Apple discussions, start here: http://discussions.apple.com/static/apple/tutorial/etiquette.html 
    Message was edited by: EZ Jim
    Mac OSX 10.7.4

  • Hello. How can I reset my iCloud because i forgot the password to my iCloud and I'm not using the email address i used in that account. What should I do?

    Hello. How can I reset my iCloud because i forgot the password to my iCloud and I'm not using the email address i used in that account. What should I do?

    Try this: https://iforgot.apple.com/password/verify/appleid
    Hopefully you have already set up your security questions.

  • The hotmail address i use for my apple ID was hacked and i no longer have access to it, this is stopping me from accessing any of my icloud or itunes. how can i fix this?

    The hotmail address i use for my apple ID was hacked and i no longer have access to it, this is stopping me from accessing any of my icloud or itunes. how can i fix this?

    Thanks, I appreciate the help.  I think this is one of the problems Apple is creating by changing the OS so often. I had fomer colleagues at [a major aerospace contractor] who told me that so many original files were ultimately lost because of the deadly change in the "Save As" operation that they are now afraid of every OS update. Apple has badly damaged their support base with that very prominent company (they won't update now until they've fully examined and understand changes in the pre-conditioned nature of OS computer functions), and they are a whole lot less enthaled with Mac-related equipment/software. Can't blame them, I too used orginal files that way (as easy-to-use templates), and lost some important files before I realized what was happening (to late to revert). Companies should not have to retrain employees each time an OS gets an update, it's can be very expensive several different ways. They learned a painful lesson with that one. And because I'm now retired and don't use multiple devices, I need iCloud like I need a hole in the head... but I'm told there's no way to keep Apple out of my computer. Fortunately, because of major problems when initially installing Mountain Lion, one hold-over of the hardware/software damage I experienced was that iCloud can no longer access my computer even though everything else is working fine again. That was the only "good luck" I had as a result of that expensive nightmare.

  • Address (how to create the right string)

    I have to pass to a JFileChooser a patch of a server directory.
    the client recive from the server the string... (example C:\ )
    now i can have the socket address with socket.getInetAddress();
    now i would like to create with those string a tring that is the right address for the server.
    Many thanks

    You can't access sockets with a JFileChooser. It is a component to see files and not IP connections
    If you need to access a directory in your server using a JFileChooser in your client, you should use something like:
    //name_of_the_server_machine/shared_directory (if you are under windows, or in linux if you can use samba or nfs)

  • How to copy the same address for multiple contacts in Address Book?

    Hi! I got a question, I didn't find an answer for yet.
    How to copy the post address from one contact to another, without manual entering. I mean if I have one contact with already entered post address, can I just copy it someway at once to another contact?
    I don't want cards to merge, I need separate contacts, that may have different phones, e-mails, but the same post address. Please, advise.

    Thanks! yes, this is a solution I'm following now. But I was wondering about the similar way as it is made in Daylite or Contactizer - you create company with name and post address first, and then can create a contact for that company. And company name and post address will appear in contact name.
    I just wonder why such a simple and useful solution isn't available in Address Book as default.
    I know there are many scripts written for Address Book. Maybe there is something for this purpose?

  • How to get the Delivery address for PO

    I have a problem.
    I am working on a SAP Script , which is for PO(Zmedruck_po) , which is a copy of
    MEDRUCK.
    I am asked to print the delivery adress in a window .
    The scenario is like this .
    In ME23N , under item details , there is a tab called DELIVERY ADDRESS
    this has option to enter the adress details or a delivery number in the  address text box .
    If the address number is present i have to print that address , else i have to print the address which is entered in the delivery address tab.
    If the delivey address number is there i have no problem in printing it ,But if address number is not there ,I need to know how to get the delivery address,
    is it the plant address, company code address ... ?
    I debuged ,but could not find out.
    Can anyone help please .

    Hi,
    try using the below method:
    Goto TWLAD table with storage location (EKPO-LGORT) as key to get address number (ADDRNUMBER).  then goto ADRC table to get the address of the delivery
    Regards
    Shiva

  • How to transfer the whole address book from one no...

    Dear friend,
    Could you please advise me "how to transfer the whole address book from one nokia to another nokia phone via blue tooth connectivity. (move one by one is not convenience for my hundreds of contact.
    Thank and waiting for advice...
    victor

    If your phones have the built-in "Transfer" (sometimes called "Switch") application, try it.
    Otherwise, depending on the model(s) you can also copy all contacts to/from the memory card, and get them over that way.
    And you can also synchronize both programs to the same service (e.g., Outlook on a Windows PC using Nokia PC Suite).
    And newer versions of Nokia PC Suite can also be used to make a backup of one phone, and then restore to another.
    PC Suite you can find here: http://www.nokia.com/pcsuite

  • HT201363 I forgot I made an apple id years ago. I dont know the password nor can I remember the password for the email address I used years ago. Can anyone help me authorize my music I bought with my super old id?

    I dont know the password nor can I remember the password for the email address I used years ago. Can anyone help me authorize my music I bought with my super old id?

    See this -> Find My iPhone Activation Lock: Removing a device from a previous owner’s account
    i just asked if someone knows the support mail, i don`t know how to someone from apple support
    -> AppleID Support - Contact Support
    Condolences to you and your family.

  • How to set the IP address in L25 Tape library

    I try to set the ip address in L25 tape library. But it is not stored in the NVRAM. For that purpose I restart the device. Then all the values are reset. please tell how to set the ip address.

    Lylee,
    Please take a look at the following links.  The first describes how to distribute your application to multiple targets when using shared variables.  The others are explaining alternate ways to change the IP address of a controller.
    How Do I Distribute a Real-Time Application with Shared Variables to Multiple Users?
    http://digital.ni.com/public.nsf/allkb/20C9771687E6BBB3862570E7006C2284?OpenDocument
    How Do I Change the IP Address of a RT Series Controller (FieldPoint, cRIO, etc) that is not on the Local Subnet?
    http://digital.ni.com/public.nsf/allkb/9F7548F5C781E05586256C75006D8B94?OpenDocument
    Real-Time Target System Replication Tool
    http://digital.ni.com/public.nsf/allkb/444A6A22A6EC50FB86257213004A878C?OpenDocument
    http://digital.ni.com/public.nsf/allkb/DDD15965085446E68625733A00451C7A?OpenDocument
    Can I Programmatically Assign an IP Address to My Real-Time Target?

  • How to resolve the IP Address in Outlook addin?

    Currently, I am using an outlook addin, which receives the mail and parses the body of the mail,and doing some database operations.
    The thing is that, using the CC email address, it assigns the task through database. But, if user uses Display Name of the CC address in their mail, Outlook addin fails to fetch the address corresponding to the CC address. How to get the CC address (Resolve
    mail address) of the Display Name used in the remote machine where the Outlook Addin is running. 

    You need to use the
    Recipients property of the MailItem class which returns a corresponding collection which
    represents all the recipients for the Outlook item. The Recipient class provides all the required properties and methods. 
    The
    Type property indicates whether a recipients belong to the CC field (TO or BCC).
    The
    Address property returns a string representing the e-mail address of the Recipient. 
    The
    Name property returns a string value that represents the display name for the object.

  • How to add the IP address helper command to the switch

    Hi
    I am trouble shooting a SF 200-48P and I am a bit lost without a CLI not used to the GUI. What I need to know is how to add the IP address helper command to the switch?
    I have a number of IP phones which are not getting an IP address from DHCP (PCs which are diasy chained off the phones are all working correctly). On the higher end switches I would have added the IP address helper command to the VLAN and that would have sorted it. However I can't seem to figure out how to do this on the small business switch.
    Thanks
    Lorne

    Thanks Rizwan. I was banging my head wishing they weren't small business switches as I felt lost without the command line!
    Lorne Gallagher | McCann FitzGerald Solicitors | Riverside One, Sir John Rogerson's Quay, Dublin 2, Ireland | DDI +353 1 607 1726 | Fax +353 1 829 0010 | www.mccannfitzgerald.ie
    Ireland Law Firm of the Year 2011 | Chambers Europe
    Ireland Law Firm of the Year 2011 | International Financial Law Review

  • When importing from my camera or file in Lightroom 5 my pictures are over-exposed by 1-2 stops, while they are well exposed on the camera-screen. How to get the 'right-exposed pictures on the screen?

    When importing from my camera or file in Lightroom 5 my pictures are over-exposed by 1-2 stops, while they are well exposed on the camera-screen. How to get the 'right-exposed pictures on the screen?

    There is an option in your Lightroom preferences on the General tab, "Treat JPEG files next to raw files as separate images". If you have that option checked then Lightroom will import and display both your raw and JPEG files. Are you using active D-lighting on your camera? If you are then you need to turn off that feature.

Maybe you are looking for