Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "getting own IP address" Watch "getting own IP address" New topic
Author

getting own IP address

Xavier Palau
Greenhorn

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) InputStream.read() 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: http://aspose.com/file-tools
 
subject: getting own IP address
 
Similar Threads
RMI Fundamentals
how to get Client Ip address?
java.net Socket port number question
Problem with simple chat app
Forward Socket to another server socket