Port used an IOException when you create a connector to 127.0.0.1 loopback address

Hello world.

I have a problem when I try to establish a connection udp to the loopback address.

The IP address of my BlackBerry phone is 192.168.1.108.

And the sender and the receiver running like a thread in the same process.

When I make a link with the IP address above, it works well.

But if I change the 127.0.0.1 IP address, then I got this IOException. "Use current port".

Here are a few excerpts from my source code.

Udc [] UDPDatagramConnection = new UDPDatagramConnection [4];

for (int i = 0; i)<4;>
{
Try
{
If (udc [i]! = null)
UDC [i]. Close();
    
String connectorURL = "udp://192.168.1.108:" + nTargetPort [i] + ";" + nSourcePort [i] + "; interface = wifi; deviceside = true;
String connectorURL = "udp://127.0.0.1:" + nTargetPort [i] + ";" + nSourcePort [i] + "; interface = wifi; deviceside = true;
System.out.println ("URL:" + connectorURL);
UDC [i] = (UDPDatagramConnection) Connector.open (connectorURL);
}
catch (IOException e)
{
System.out.println ("in CreateRtpConnection, IOException:" + try ());
e.printStackTrace ();
Returns false;
}
}

If I use the 192.168.1.108 as destination ip address, it works great every time.

But with 127.0.0.1, it fails 100%, even if I restart the BlackBerry smartphone.

Please help me with this problem. I use 127.0.0.1 because I do not know how to get the local IP address.

I have all hard coded IP address.

Thanks in advance for your help.

EDIT: Remove personal information

There is no interface loopback on blackberry, 127.0.0.1 is not a valid ip address for it.

int apnId = RadioInfo.getAccessPointNumber("MagicRudyAPN.rim");
            byte[] ipByte = RadioInfo.getIPAddress(apnId);
            host_addr = "";
            for (int i = 0; i < ipByte.length; i++) {
                int temp = (ipByte[i] & 0xff);
                if (i < 3)
                    host_addr = host_addr.concat("" + temp + ".");
                else {
                    host_addr = host_addr.concat("" + temp);
                }
            }

Tags: BlackBerry Developers

Similar Questions

  • Is it Possible to use a function when you create a table?

    Hello

    Is it possible to use a function during the construction of a table?

    I would like to browse my data returned from the db and call a function. The part where I call the function "myFunction [i]" doesn't seem to work. How can I solve this problem? I need to put the function call results in the table.

    var i: uint;

    for (i = 0; i < dataArray.Length; i ++)

    {

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}];

    }

    Thank you!
    -Laxmidi

    Hi laxmi,

    Yes of course it is quite possible to use a function when you create a table... In your code, you made some mistakes...

    You used hooks to call the function myFunction [i]... where you are supposed to use parentheses... myFunc (i)... and other you must push the object in the dgArray but yous hould not not attribute...

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}]; This will result in only the last table iterates in dgArray...

    So you should write dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});

    Check out the code below...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >

      private var dgArray:Array = new Array();
    private var myDataArray:Array = [{data: '1', name: 'Robert'}, {data: '2', name: 'Nicolas'}, {data: '3', name: "Bika"}]
     
    private function init (): void
    {
    for (var i: int = 0; i
    {
    dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});
    }
    }
      
    private void myFunction(i:int):String
    {
    Return 'Type' + i;
    }
    ]]>

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • XP Pro SP 3 - using WPA - 2 when you create a new wi - fi connection...

    When you are prompted to enter the password on the device, the Connection Wizard does not accept letters, numbers only.  Anyone know how to change the settings to accept the letters in order to use a network?

    When you are prompted to enter the password on the device, the Connection Wizard does not accept letters, numbers only.  Anyone know how to change the settings to accept the letters in order to use a network?

    What do you mean "enter the password on the device"?  Are what device you referring?

    It is not necessary to use the wireless network Setup Wizard.  IMO, it's more trouble that it's worth.  Assuming you use Windows Wireless Zero Configuration (WZC) to control your wireless adapter, simply "view available wireless networks", select OK, and then click on connect.  When you are prompted, enter the p/e.

    See http://youtu.be/AwzYwz7aGho
    You should not use WZC if you have another utility asset (provided by the manufacturer of the laptop or a wifi adapter) configuration.  Having two wireless configuration utilities active simultaneously leads to problems.

  • The number of characters is allowed when we use the ' have value in ' option when you create a filter?

    The number of characters is allowed when you use the option "value in" when you create a filter?

    Hey,.

    300 characters are allowed when we use the option "value in" everything by creating a filter.

    Thank you

  • All trying to deploy Linux VM model using PowerCLI, during customization in error that "do not provide dns when you create NIC mapping for customization with type 'Linux" ".

    All trying to deploy Linux VM model using PowerCLI, during customization in error that "do not provide dns when you create NIC mapping for customization with type 'Linux" ".

    See my response on the other thread where you posted the same question.

  • How to specify the file of virtual hard disk when you create a new virtual machine using virtual hard disk on the data store?

    I'm new to PowerCLI and find quite simple, but in the documentation I read, I don't see how to use a virtual hard drive, existing on a data store when you create a new virtual machine.

    Is this simple registration on the virtual hard disk, or did I miss something?

    My current create VM is the following statement:

    New-VM

    -Name $TargetHostName -host $TargetVMCenterHost -data store $TargetVMCenterDatastore DiskMB - 20000 -MemoryMB $TargetHostMemoryMB -NumCPU $TargetHostCPUs -ID $TargetHostOS -CD -Description $TargetHostName

    Didn't notice this before, but I think that vSphere will use a backslash instead of a slash in the paths.

  • When you create a new DPS use sizes offered by InDesign or the size of the unit?

    Hi all

    When you create a new DP, use sizes offered by InDesign or the size of the unit?  I fell on this question when I was looking for the sizes of the various devices and found that the iPhone 5 s, iPhone5c and iPhone4s sizes differ the defauly dimensions offered by InDesign.

    Also, should I worry about the DPI of resolution?  With the iPhone, they all seem to be 326ppi, but when it comes to other devices it's something I should consider?  Ideally, I could create DPS apps for all devices offered in digital publishing in InDesign (iPhone, iPad, Kindle Fire/Nook and Android).

    Thanks for any help you can provide.

    Also, if it helps I use InDesign CC.

    1024 x 768 using and creating PDF articles you will get OK with the two resolutions of the iPad, and Bob L. said, result 'quite decent one size fits all' for all other devices.

  • Get the blue screen when you create a new message or the response message in OWA Exchange 2007

    Get the blue screen when you create a new message or the response message in OWA (Exchange 2007)

    Hello

    I suggest you post the question in the forums and check them off below if it helps:

    http://social.technet.Microsoft.com/forums/en-us/exchangesvrclients/

    It will be useful.

  • When you create a new message in Windows Mail only some contact appear just by typing the first few letters of their name

    Original title: Windows mail contact probrem

    When you create a new email, why some of my E-mail contacts appear with just by typing the first letters of his name while other contacts in my list do not appear?

    for example, if I send an email to alan, so when I type the letter 'a' all contacts beginning with 'a' used to appear and you can select whatever you want. This is not the case now, and I have checked the contacts that do not appear are saved the same way as those that appear.

    Any suggestions please

    WinMail stores AutoComplete addresses in the registry and it has a maximum of 29. Claire on some dead wood.
     
     
    How to remove an address from the list of AutoComplete in Windows Mail
    http://email.about.com/od/windowsmailtips/Qt/et_del_autocomp.htm 
  • When you create a new email a first letter of the contact request full email address on frequent contacts.

    original title: contact prompting

    When you create a new email a first letter of the contact request full email address on frequent contacts. How to extend the time, what he remembers of those contacts?

    WinMail remembers only 29 addresses used through the registry. These links will give you a few options.

    How to delete registration completion email in Windows Mail
    http://www.Winhelponline.com/articles/245/1/how-to-clear-the-email-auto-complete-entries-in-Windows-mail.html

    How to remove an address from the list of AutoComplete in Windows Mail
    http://email.about.com/od/windowsmailtips/Qt/et_del_autocomp.htm

  • Implementation for the Apps Error signature: "ioexception when you save the new key pair".

    I'm following the instructions of setting up registration your apps: https://developer.blackberry.com/html5/documentation/signing_setup_smartphone_apps_1920010_11.html.

    After typing the password and move the mouse around, I get a message, "ioexception when you save the new key pair". BB forums say that the problem is that my JDE is not installed, but it is. I'm also not using windows 7. Does anyone know how to fix this?

    As for all my messages, within the hour to ask, I always find the solution.

    http://ekkescorner.wordpress.com/blog-series/blackberrydev/secure-development-of-blackberry-applicat....

    However, it is normal that the instructions on the page webworks lack incredibly. I went with anger poster yesterday on the development of how awful all for blackberry is, and how absurd it is that there is no phone tech support. I decided yesterday against him because I felt bad for RIM as they seem to get into financial trouble. I've been on the fence about BB, and I tried to tell my friends that the newest smartphone looks like it could be promising. While it is true, I have not developed for BB 10 again, if it's developers resources also lack 7 are, I have no doubt that soon she will fail and I will give is more no support.

  • Why the Amazon icon will not appear when you create a shortcut

    When I create a shortcut to a Web site; instead of the web logo, I get the blue standard & green "globe".

    How can I correct this (windows 7)?

    Thank you

    Clyde

    Hello

    You are welcome.

    Shortcuts to sites will initially their own custom icon when you create a shortcut. This icon is called a "favicon.ico" and is stored in the temporary Internet files (TIF) cache, which is where all website files, are stored when you visit them.

    When the user performs a maintenance and removes the TIF cache, all these custom icons are removed with everything else. This will cause the icon of Internet Explorer by default to display on these shortcuts. This also occurs when the maximum allowed disk space has been exceeded and that the files are deleted automatically to maintain the use of disk space.

  • [JDev 12.1.3] The difference between the Type of Document "Facelets" and "JSP XML" when you create a new page?

    Hallo,

    that is the difference between choosing as a Type of Document "Facelets" and choosing "JSP XML" when you create a new page?

    Which is the best choiche and why? And is it possible to convert a page from one type to another?

    Thank you

    Federico

    Hi Federico

    JSPX both Faceletes are equal to the feature and after Jdev Release11gR2, both are supported in the ADF

    Facelets is deemed be better performance because it is more tight integrated with life cycle JSf and does not need to be compiled before running

    The future speaks Facelets (specification of JSF) and if start you a new project in development with JDeveloper 11 g R2 then we recommend you use Facelets for this reason

    See this good discussion -Diff b\w JSF and JSPX

    Thank you

  • When you create a doc lost the icon sheet top/left.

    The top left icon sheet when you create a doc disappeared when I upgraded from version demo paid...

    Now I can't save as template or doc, so I can't use the fields from the previous version by slightly changing a document,

    I have to put everything from the beginning

    How to get the icon back?

    Hello Aireclaim,

    I believe you are referring to layer model of form field that can be applied to the upper left side overview page. The option is available in the business account only and not in individual account (sending to the signature).

    Kind regards

    -Usman

  • How do you get the layers work correctly when you create a document merged into the InDesign data merge feature?

    Hey everybody,

    I working on a card game using data with a .csv file merge and spin in unusual behavior when you create a merged document when my master document had layers.  Imagine I had a layer of structure that looks like this:

    Layer has
    -< DataMergeFrameA >

    -Cooked in the static element
    Layer B

    -Cooked in the static element B
    -< DataMergeFrameB >

    -< DataMergeFrameC >

    Layer C
    -Cooked in the static element C

    -< DataMergeFrameD >

    Preview, this hierarchy is respected and the image is superb.

    When I create my merged document that each individual card includes this editable structure:

    Layer has
    -< DataMergeFrameA >

    Layer B

    -< DataMergeFrameB >

    -< DataMergeFrameC >

    Layer C

    -< DataMergeFrameD >

    And the order in which the elements are drawn resembles what happened past:

    -< DataMergeFrameA >

    -< DataMergeFrameB >

    -< DataMergeFrameC >

    -< DataMergeFrameD >

    -Cooked in the static element

    -Cooked in the static element B

    -Cooked in the static element C

    I would * really * like solving this problem without going through a column of data fusion with just the same picture in each area or something stupid like that, especially because some of my other static elements are generic text boxes. Is it possible to apply the stacking order in a merged document?

    I have attached a screenshot of the preview and the merged document.
    * WARNING: The main art is a temporary placeholder *.

    The one on the left is how it looks in preview. The second is the merged document. The major problems are that a) static grass image should appear on the art main and b) main image overlays areas of main text on the left. How can-

    InDesignPreviewBug.pngInDesignMergedDocumentBug.png

    Try moving it all off the master and on the page of document in the model.

Maybe you are looking for