×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    simple socket connection...

    Hello there,
    I have a midlet (runs on 8862) which tries to open a socket connection as follows.

    Code:
       try{
                    String url = "socket://yahoo.com:80";
                    showMessage("Connecting... to " + url);
                    SocketConnection sc = (SocketConnection) Connector.open(url);
                    showMessage("Connected");
                 }catch (IOException ioe){
                        showMessage("Connect failed.." + ioe.getMessage());
                 }catch (SecurityException se) {
                        showMessage("Connect failed.." + se.getMessage());
                 }
    This always throw SecurityException immediately. API doc says
    SecurityException - May be thrown if access to the protocol handler is prohibited.
    What does this mean ? My jad file has permission for Connector.socket class.

    Also, as you already know, on 6682 we can create as several access points. So when I open a socket which one will be picked ? Is there a way to specify which one to pick ? It works fine on the emulator.

    Please shed some light.
    ~B

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: simple socket connection...

    MIDP recommended security policy states

    "The implementation of SocketConnection using TCP sockets MUST throw java.lang.SecurityException when a MIDlet suite belonging to the Unidentified Third Party Protection Domain attempts to connect on ports 80 and 8080 (http) and 443 (https)."

    Hartti

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    Re: simple socket connection...

    Thanks hartti,
    I tried using other ports as well - telnet, and some arbitory port (2525).
    But.. I get the same exception.

    There is a similar thread
    http://discussion.forum.nokia.com/fo...ad.php?t=68306

    But it looks like he was able to get it working after signing the midlet.
    In my case it is signed with proper permissions. I am able to use bluetooth without any issies.

    What else is involved ?

    any idea ?
    thanks you

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: simple socket connection...

    Ouch... I did not realize earlier that your device most likely is a Cingular branded device... right? (As 6682 was distributed through CIngular only)

    In this case the bad news is that Cingular does not allow socket connections at all for unsigned application or trusted 3rd party apps. This is explained in the Cingular developer web site in a document called Java Signing Requirements.

    Hartti

  5. #5
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    Re: simple socket connection...

    Thats you hartti, you're right. http connection works fine for me.

    Still I wonder how did the guy posted http://discussion.forum.nokia.com/fo...ad.php?t=68306 sait it worked for him.
    He says he has a 6682 from cingular.

    Anyway.. thanks for helping me out.

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: simple socket connection...

    Hmmm.. the way I read the thread you pointed to, the guy wrote it did not work for him with 6682
    http://discussion.forum.nokia.com/fo...ad.php?t=68306

    Hartti

  7. #7
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    Re: simple socket connection...

    So are sockets just broken on the 6680/6682, or do I have to have a "real" cert?
    Sorry, I did not see that part.
    So.. that explains all

Similar Threads

  1. Unable to do a socket connection
    By PriyankaChaurishia123 in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2006-02-13, 17:53
  2. problem in persistant socket connection
    By poms4symbian in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-03, 13:23
  3. socket connection problem
    By bhatti81 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-10-08, 14:43
  4. opening a socket connection
    By bhatti81 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2003-07-16, 10:08
  5. PC Sync with 6310i and Socket BT Connection Kit
    By sami_laiho in forum Bluetooth Technology
    Replies: 0
    Last Post: 2002-09-17, 05:25

Posting Permissions

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