This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring 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?
I agree. Here's the link:
subject: getting own IP address
It's not a secret anymore!