×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    8

    Using ServerSockets in Midlet

    Hello

    I am trying to write a simple Midlet which makes use of the ServerSocket class available for J2ME. Only when I compile a project using it for example the project TCPEchoServer included in the MIDP_2_0_Introduction_to_Using_Sockets_and_Datagrams_v1_0 tutorial.

    I am unable to get it working, it seems to compile fine but when I try it out on my Nokia 6681 it doesn't work for me. Sometimes I am getting a Symbian error -34 or totally nothing work. It asks if I allow to connect to it, though.

    How can I compile a project in Eclipse+EclipseME to make use of the Serversocket class?

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

    Re: Using ServerSockets in Midlet

    hi,

    that sample comes with precompiled TCPEchoServerMIDlet.jar (jad),
    is this working for you while copied on real device?
    it should show error messages if obtaining connections is failing or listening port cannot be bind,

    regards,
    peter

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    8

    Re: Using ServerSockets in Midlet

    Yes, the precompiled jar files work just fine. That's what is so strange... I am using the Sun Wireless Toolkit for compiling.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    8

    Re: Using ServerSockets in Midlet

    Could this happen because of a bad manifest or jad file? Or maybe because I am using the wrong SDKs? I am using a Nokia 6681, and I would like to make a simple socketserver midlet which should become active when a different application (i.e. a different midlet or symbian app) is trying to connect to 127.0.0.1:6006.

    Only I am not getting it to work. Basically I want to make a local server written in j2me.

    Are their any SDKs I must use? Currently I am using WTK22

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    8

    Unhappy Re: Using ServerSockets in Midlet

    Anyone? I would really like to solve this problem...

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

    Re: Using ServerSockets in Midlet

    Quote Originally Posted by laurahodges
    I would like to make a simple socketserver midlet which should become active when a different application (i.e. a different midlet or symbian app) is trying to connect to 127.0.0.1:6006.
    not sure, but it seems that you are trying two different things:
    #1
    register application via PushRegistry to be invoked/started if it receives data on 6006 port
    #2
    provide communication between different applications using Socket connections, which is this case shouldn't use 6006 port for that I think (so your starting appliation should use different port as 6006 for socket connection),

    am I correct on what you're planning?
    regards,
    peter

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    8

    Re: Using ServerSockets in Midlet

    Well, I want to make a midlet which listens to a specific port (dont care which one). The idea is that I have the midlet running, and then I go the S60 webbrowser and then I can do http://127.0.0.1ort/help to show a interactive documentation.

    Maybe I need to selfsign the midlet before I an succesfully use it? The strange thing is that the compiled jar included with Nokia example works perfectly, but when I try to make something similar or compiel it myself it doesn't work!

    Maybe because I can't find the same SDK as they used? I am getting the feeling that one of the following things are the case:

    * You can't use ServerSocket on a 6681 when compiled Sun's WTK22
    * You can't use ServerSocket on a 6681 because you don't use Nokia UI jars?

    If anyone happen to have a example how to use ServerSocket on a 6681 would be awesome.

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

    Re: Using ServerSockets in Midlet

    hi,

    if nokia sample works with the same solution then compare .jad/manifest entries for api permissions, etc (nokia ui api is user interface related not network/generic framework related api),
    regards,
    Peter

Similar Threads

  1. calling midlet from midlet throws SecurityException on 6600
    By brianpegan in forum Mobile Java General
    Replies: 3
    Last Post: 2010-10-25, 05:31
  2. question on wma jsr 120 again
    By egc_33 in forum Mobile Java General
    Replies: 2
    Last Post: 2006-09-19, 00:27
  3. Midlet freezes on Nokia 3230
    By jawwadhussain in forum Mobile Java General
    Replies: 1
    Last Post: 2006-07-05, 07:59
  4. 'Response Unknown' when downloading midlet
    By Weevil in forum Mobile Java General
    Replies: 3
    Last Post: 2004-05-30, 17:01
  5. How to create two instances of midlet
    By marquito99 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-04-30, 01:33

Posting Permissions

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