Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 53865 invoked by uid 500); 20 Nov 2002 09:33:41 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 53829 invoked from network); 20 Nov 2002 09:33:40 -0000 Date: Wed, 20 Nov 2002 10:31:12 +0100 (GMT-1) From: Damir Dezeljin X-X-Sender: damird@Server.nib.si To: APR Subject: apr_sockaddr_info_get: Posible bug Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi. I'm trying to bind a socket to a certain port on all my local interfaces, so I check which function can I use to construct apr_sockaddr_t address to which bind my socket. >From the manual I found: --- apr_status_t apr_sockaddr_info_get ( apr_sockaddr_t ** sa, const char * hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t * p ) ---- Create apr_sockaddr_t from hostname, address family, and port --- It look like that this function is used to initialize and construct apr_sockaddr_t variable. So I use: --- apr_sockaddr_t *sa=NULL; ... apr_sockaddr_info_get( &sa, APR_ANYADDR, APR_INET, 20000, APR_IPV4_ADDR_OK, my_pool ); ... apr_bind(apr_sock, sa); --- But this doesn't work. After this function call sa on Linux platform always points to NULL, on Windows it points where it was pointing prior function call. I'm using a CVS snapshoot of the APR library. Is this an error in the APR soucer or in the manual? I'm now using the below code to construct apr_sockaddr_t: --- apr_socket_addr_get(&sa, APR_LOCAL, apr_sock); apr_sockaddr_port_set(sa, PORT); apr_sockaddr_ip_set(sa, APR_ANYADDR); --- Is there any more 'elegant' way to do this? I also have one question which isn't related to the above problem. I post a mail with a problem linking my program with the APR library some days ago. I then realized that if I build a dynamic library, my application works fine, whiles when I try to construct a static library I can't link my application. Also any sugestion for this? Regards, Dezo