You need to use the GetOpt() function of the sockets with an option level = KSolInetIfCtrl and an option name = KSoInetConfigInterface. The information of the desired interface will be returned in a TPckgBuf so be sure to use it in the GetOpt. Then you just need to extract the informations you want, like the IP address.
If you use this, first you need to connect a socketSer, open a socket for the tcp/ip protocol, use SetOpt with an option level = KSolInetIfCtrl and option level = KSoInetEnumInterfaces. Then you will use the GetOpt().
I don`t have here the code or SDK`s help but if you check out the help in the TCP constants section you see what i`m talking about.
I don`t quite understand what you said before, could be explain a bit better? Are you using UDP?
The thing is, for you to get the IP address of an interface or routes, the interface has to be created. If you don`t have a connection to a server the interface won`t be created ( unless you create it yourself). For example when you browse around in Opera, if you implement a function that gets informations concerning the interfaces, you will get a new one because of the GPRS connection. When you turn off your browser after a while the GPRS interface will disappear.
Please explain better your problem in order for me to write a more direct and satisfatory reply.OK?
hey i have the same doubt. how can we know what the ip address of our mobile is??? how can we extract that ip address and access points in a j2me program??? im new to this field so could give me sum link or a sample code that in detail explains the procedure.
any suggestions would be highly appreciable