How can get local and remote IP address from TCP connect?
Hi,
Calling TCP connect from client side resuting four elements of the association 5-tuple to assigned, local-addr, local-process, foreign-addr, foreign-process. Is there any way to get the local and foreign IP address from the system after calling TCP connect in a C++ program? Thank you. Kind Regards, Jupiter |
dunno if c++ has native ones, but you could always extern 'C' and use getpeername and getsockname
|
You should also take a look at Beej's Guide. For example:
http://beej.us/guide/bgnet/output/ht...t.html#connect Code:
while(1) { // main accept() loop |
All times are GMT -5. The time now is 09:08 AM. |