×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    8

    Issue with socket connections

    Hello,

    I have an issue with socket connections in my Java application. I use the following code:

    Code:
     try {
     connection =(SocketConnection) Connector.open( "socket://" + serverIp + ":" + serverPort );
     } catch (ConnectionNotFoundException cnfe) {
    On Nokia SDK 1.1 emulator for Java and S60 ConnectionNotFoundException raises;
    on standard WTK emulators connection establishes successfully and everything works OK as well as on other S40 emulators.

    I receive the following diagnostics:

    Code:
    javax.microedition.io.ConnectionNotFoundException: Connection refused
     at com.sun.midp.io.j2me.socket.Protocol.connect(+168)
     at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+64)
     at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+8)
     at com.sun.midp.io.j2me.socket.Protocol.openPrim(+108)
     at com.sun.midp.io.InternalConnector.openPrim(+157)
     at com.sun.midp.io.InternalConnector.open(+9)
     at javax.microedition.io.Connector.open(+6)
     at javax.microedition.io.Connector.open(+6)
     at javax.microedition.io.Connector.open(+5)

    What could be the causes of this diagnostics? Are there any workaround?
    Thank you.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Issue with socket connections

    Hello,

    I don't see any problems with the code. I couldn't reproduce this issue on Nokia SDK 1.1 when attempting to connect to a socket address and port number. This seems to be related to the connectivity settings of the Emulator and/or your network settings. Have you tried the following ?

    a) After the Emulator is launched go to Tools > Preferences > Networking > Use a proxy server address and a port number that matches your network configuration if needed (this especially applies to corporate LANs) > Relaunch the Emulator.
    b) In the same window, try modifying the interim RMI registry port to 9999
    c) Ensure that you can connect to the Web using the Emulator's browser. If already your application is launched, press the call termination button, Menu > Internet > attempt to connect to an address.
    d) Which version of Nokia SDK 1.1 do you have? Beta or Final? In case you had downloaded the beta version, try updating to the Full version.
    e) I tested the snippet on windows 7 (32 bit), with Java 1.7.0_03. In case you have an old version of java (on cmd > java -version), try updating your Java from here
    f) What happens if you attempt to connect to another socket address and port number?

  3. #3
    Registered User
    Join Date
    Apr 2012
    Posts
    8

    Re: Issue with socket connections

    It seems that all connectivity settings of the Emulator and my network settings is fine cause Emulator's browser connect to the Web,
    i'm using full version Nokia SDK 1.1, i'm working on windows 7 (32 bit), with Java 1.7.0_03,
    BUT when attempting to connect to another socket address and port number i geting ConnectionNotFoundException
    on this emulator even NetworkDemo from WTK examples don't work properly,
    is there any idea about that?

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Issue with socket connections

    You might want to try the professional support channel for this one, where you can share the port number(s) and socket address(es) you have tried, so that you get dedicated support and one of our experts can verify the issue.
    Last edited by skalogir; 2012-05-11 at 21:07.

Similar Threads

  1. multiple socket connections
    By jhnns in forum Mobile Java General
    Replies: 4
    Last Post: 2009-07-11, 18:04
  2. Java Socket connections
    By amol28kulkarni in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-01-31, 19:00
  3. socket connections with PushRegistry
    By antonio blazquez in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-06-01, 01:11
  4. Sample code which uses the Push Registry with socket socket and datagram connections
    By mukteshwar in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-04-12, 08:40
  5. Socket connections
    By kapapra in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2003-10-08, 08:17

Posting Permissions

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