Meaningless Drivel is fun!*
The moose likes Java Micro Edition and the fly likes getting own IP address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "getting own IP address" Watch "getting own IP address" New topic

getting own IP address

Xavier Palau

Joined: Oct 26, 2001
Posts: 1
I'm programming a MIDLet that is basically a peer2peer application. So, I use different threads for the client part and the server part and use HttpConnection and socket connections. It is actually working on the real device, but I have found two problems:
1 - I don't know how can I get:
a) from the socket (server part): the IP address of
the client that has requested a connection
b) from the client: its own IP address
2- Even when I only attend a client at the same time and close the socket, when I have attended 3 or 4 connections seems that this 2 methods get blocked simultaneusly:
a) notifier.acceptAndOpen() at server part
b) at client part
the worse thing is that the threads get blocked for ever (no timeout).
Please, can you help me with any of the two problems?
It is sorta covered in the JavaRanch Style Guide.
subject: getting own IP address
Similar Threads
how to get Client Ip address?
RMI Fundamentals
Problem with simple chat app Socket port number question
Forward Socket to another server socket