get IP from socket connect from localhost in java -


how ip of socket conncet localhost ?

i try :

serversocket ss = new serversocket(1919);         socket test,s = new socket("127.0.0.1",1919);          test=ss.accept();         system.out.println("we connect ");          inetaddress ip=test.getinetaddress();         system.out.println("ip of system := "+ip.gethostaddress()+"----"+ip); 

the out put :

ip of system := 127.0.0.1----/127.0.0.1 

but need : ip:192.168.0.xxx

thanxx

i need : ip:192.168.0.xxx

you never it. wrong answer. socket connected via 127.0.0.1, source address can 127.0.0.1.

if connected socket 193.168.0.xxx source address.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -