Damir Dezeljin <[EMAIL PROTECTED]> writes:

> Hi.
> 
> I writen an daemon which is executed in inetd (part of the code is below).
> I have problems getting remote IP address and remote port. I use:
>   apr_socket_addr_get(&addr_local, APR_LOCAL, apr_sock);
> to get local address and port, and
>   apr_socket_addr_get(&addr_local, APR_LOCAL, apr_sock);
> to get the remote one, but this doesn't work (I get 0.0.0.0 for the IP and
> port 0).
> 
> Any sugestion in welcome.

looks like there's a bug getting in your way :)

the APR code assumes that we always know the remote address because it
is filled in by apr_os_sock_make() or apr_connect() or apr_accept()

but your situation was different... the socket was already connected
and you called apr_os_sock_put()

note that you could have called apr_os_sock_make() and specified the
remote sockaddr, but you want APR to do all the work and it is falling
down on the job

I'll see what I can do.

-- 
Jeff Trawick | [EMAIL PROTECTED]
Born in Roswell... married an alien...

Reply via email to