×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    6

    Socket Connection attempt allways blocks

    I've been working on a midlet that creates a socket connection via wifi. Well that's the idea way. The application works well using the emulators, but when i run it on a real phone it blocks on Connector.open(..) line. So far i've tested on a e65, n95 and a black berry.

    connection = (SocketConnection)Connector.open("socket://<ip>:<port>;interface=wifi;deviceside=true",Connector.READ_WRITE,true);

    Any insight would be greatly appreciated.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Socket Connection attempt allways blocks

    Are you sure it blocks, or throws an exception (that's getting caught and ignored)?

    You're using some scheme parameters, and I doubt the devices support these. So far as I know, "deviceside" is unique to BlackBerry devices. I think "interface" is BB also. Try excluding these options.

    Graham.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    6

    Re: Socket Connection attempt allways blocks

    Quote Originally Posted by grahamhughes View Post
    Are you sure it blocks, or throws an exception (that's getting caught and ignored)?

    You're using some scheme parameters, and I doubt the devices support these. So far as I know, "deviceside" is unique to BlackBerry devices. I think "interface" is BB also. Try excluding these options.

    Graham.
    Well it blocks for a couple of minutes and eventually throws the time out exception. As for the scheme parameters i've tried removing them and every which way that is possible. There was someone else that had socket problems with the exact same two phones i have been testing it on (e65 and n95)
    http://discussion.forum.nokia.com/fo...ket+connection

    Could these two phones just be bad with socket connections? If anyone has done this on either of these phones i would love to see how...

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Socket Connection attempt allways blocks

    Are you using an IP address or a domain name?


    Socket connections should be fine. It's more likely to be the network than the phone that's your problem. Are you testing all the phones on the same network?

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    6

    Re: Socket Connection attempt allways blocks

    Quote Originally Posted by grahamhughes View Post
    Are you using an IP address or a domain name?


    Socket connections should be fine. It's more likely to be the network than the phone that's your problem. Are you testing all the phones on the same network?
    Been trying both domain and ip. I have been testing under my home wifi so perhaps thats to blame then? the phones work fine for general net surfing using the same network though...

    It was being tested elsewhere on other networks, but it was only on my home wifi that i could be sure it was blocking on the Connector.open(...) line. How ever i later discovered there was an issue with inputStream.read(byte[]) which was also blocking if the socket connection was successful. Using inputStream.read(byte[],int,int) instead fixed this. So i have now got the application working on a black berry phone. I have yet to test it on a nokia, but it seems my local wifi is no good for it...

Similar Threads

  1. Replies: 1
    Last Post: 2007-12-10, 14:41
  2. Does Nokia 6630 supports Socket Connection?
    By kishorekadiri in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-02-21, 05:20
  3. Unable to do a socket connection
    By PriyankaChaurishia123 in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2006-02-13, 17:53
  4. problem in persistant socket connection
    By poms4symbian in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-03, 13:23
  5. Socket problem
    By defragger in forum Symbian
    Replies: 0
    Last Post: 2005-08-25, 08:16

Posting Permissions

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