×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    3

    SocketConnection and ServerSocket : problem

    I have written a few programs, which use SocketConncetion. For server side I have used ServerSocket. Everything was OK till I worked in emulators, but in real phones NO. The problem was when I wonted to connect to the server which run on my Computer using real phone. Phone asked me if I wont to connect, i answered yes and after that nothing. G was on the left and application waited on
    socketConnection = ( SocketConnection ) Connection.open("socket://myComputerort");
    After that I tried whit simpler application which just connect to the server but it was the same.
    Can anyone hepl?
    Thanks
    Gliga

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: SocketConnection and ServerSocket : problem

    stupid question: is your computer reachable from Internet (meaning: is the IP address in the URL visible to other computers - like your phone - in the Internet)?
    Also have you properly defined an access point so Java midlets can connect to servers.

    Hartti

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    3

    Re: SocketConnection and ServerSocket : problem

    Quote Originally Posted by hartti
    stupid question: is your computer reachable from Internet (meaning: is the IP address in the URL visible to other computers - like your phone - in the Internet)?
    Also have you properly defined an access point so Java midlets can connect to servers.

    Hartti
    First thanks.
    But on both questions are the same answer: yes.
    Some other idea

    Gliga

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: SocketConnection and ServerSocket : problem

    Which device are you using? Are you using WAP or Internet Access Point?

    Hartti

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    3

    Re: SocketConnection and ServerSocket : problem

    Quote Originally Posted by hartti
    Which device are you using? Are you using WAP or Internet Access Point?

    Hartti
    I used 7610 and internet.

    I also tried HTTP but problem was the same. Just stop when tried to open. Server side is tested whith basic desktop application and it worked.
    I hope that you will have some ideas.

    Thanks in advance.
    Gliga

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: SocketConnection and ServerSocket : problem

    More guesses: Operator has blocked access to that port - did you try HTTP to a normal HTTP port (80)?
    Your phone is a operator variant (customized version for a operator) and using the network connections require signed midlets (although you should get security exception here).
    There is something wrong with your code - have you checked the networking examples on FN web site and Sun's web site?

    Hartti

  7. #7
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: SocketConnection and ServerSocket : problem

    hi Gliga,

    provide a handling for runtime errors, if SecurityException is thronw while using SocketConnection due to using restricted ports (80, 447, 8080 eg) you should see that, handle other exception that way you are seing exception message or stack trace while testing on device,
    open connection manager on phone and see if you get any response from server at all (data could be sent but not received at all),
    use logs file on server side - that is flush data received by socket server to local file as well and check if you received data from mobile device at all,

    regards,
    peter

Similar Threads

  1. Server Socket Problem on Nokia 6680: acceptAndOpen does not work
    By opistara in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2009-08-06, 11:20
  2. Please Read:Network Problem on the Nokia 3220
    By u4215522 in forum Mobile Java Networking & Messaging & Security
    Replies: 30
    Last Post: 2006-06-02, 15:39
  3. SocketConnection Work on 6600&Emulators BUT NOT IN 6680
    By eerant in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2006-03-11, 00:35
  4. Socket Connection problem
    By Ojak Dev Sharma in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-03-03, 15:11

Posting Permissions

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