get the remote port number

Jun 6, 2012 at 11:25am
I have a c++ cgi script that gets called and I get the IP address of the client like so:

char* remote_host = getenv("REMOTE_ADDR");

But I need to get the remote client port numer as well. I believe that APACHE doesn't set the REMOTE_PORT so can I get it using sin_port or anyting??

How can I do this???

Thanks
Jun 6, 2012 at 11:45am
Topic archived. No new replies allowed.