PDA

View Full Version : how can i get IP address



dognzhe
12th May 2009, 03:09
does any one know how to get the IP address in the server side? I want to know the IP address of each client that connect to the this server.

it is very weird that both Qtcp and Qupd socket class don't have method like getIP().
send the IP address from client side as transmission data is not always good idea.

most of client are behind router, it will return local IP and it is not reliable

aamer4yu
12th May 2009, 06:27
May be QAbstractSocket::peerName or QAbstractSocket::peerAddress might help you :)