apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: find the bind port in apr version 1.0.1
Date Wed, 22 Dec 2004 20:01:18 GMT
On Wed, 22 Dec 2004 20:54:23 +0200, Dror Shilo <Dror.Shilo@ericom.com> wrote:
>  
> 
> In apr version 1.0.1 the function 
> 
> apr_sockaddr_port_get was removed. 
> 
> So if you bind to port 0 , and after the bind you have to find the port that
> was peeked . how you can do it ? 

You need to call apr_socket_addr_get(&x, APR_LOCAL, s) to fill out a
sockaddr with local address information, after which you can reference
the port field in the returned sockaddr.

The old apr_sockaddr_port_get() function didn't eliminate the need to
call apr_socket_addr_get().

Mime
View raw message