×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    16

    J2ME accept socket connection

    Hi!

    I want to write a J2ME application, which accepts socket connection. If I try simple to listen on a socket, than the problem is, that the application is listening on localhost (127.0.0.1):

    try {
    serverconn = (ServerSocketConnection) Connector.open("socket://:" + 5000, Connector.READ_WRITE);
    get_listBrowser().setTitle(serverconn.getLocalAddress()+":"+serverconn.getLocalPort());
    SocketConnection conn = (SocketConnection) serverconn.acceptAndOpen();
    } catch (IOException ex) {
    ex.printStackTrace();
    }

    I want to write an application, which first shows an access point selection dialog and connects for example to a rooter, so it can have an IP address, and after it it starts to liten on this ip address and the specified port. It is quite similar than the RConnection in Symbian.

    Is that possible to do in J2me?

    Thanks!

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: J2ME accept socket connection

    I want to write a J2ME application, which accepts socket connection. If I try simple to listen on a socket, than the problem is, that the application is listening on localhost (127.0.0.1):
    Are you sure with this? AFAIK the sequence above ensures your machine to listen on port 5000 on any interface.

    I could not make the "socket://localhost:5000" run, so that I can open my local browser and type "http://localhost:5000" and my server is invoked. This did run on my old N70, but not no the N95... I'm getting sick with all that...

    J2ME is hell...

Similar Threads

  1. Bluetooth Socket Connection Problem
    By deniz6682 in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2006-03-08, 08:07
  2. Opening socket connection fails
    By Hardcoreprogrammer in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2005-01-17, 08:37
  3. Socket connection on 7650
    By crony94 in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-02-28, 17:03
  4. Bluetooth Socket Connection MIDP 2.0
    By dleeICT in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-02-13, 18:04
  5. test framework and socket connection problems
    By nawkboy in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2003-02-22, 00:03

Posting Permissions

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