[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-devel
Subject:    Re: init, open, and close
From:       "Kurt D. Zeilenga" <Kurt () OpenLDAP ! org>
Date:       2000-08-21 22:58:12
[Download RAW message or body]

At 05:33 PM 8/21/00 -0400, Michael Rothwell wrote:
>I'm writing a Gnome panel applet to do address-book (mainly phone
>extensions) lookups from an Exchange server using LDAP. The problem I'm
>having is with closed connections. Is there a way to tell if a
>connection returned from ldap_init() and/or ldap_open is now invalid?

Do any API call which generates a request and example the
result code returned.

> If
>I re-run ldap_init() on each request, it works, but piles up open
>connections.

Use ldap_unbind() to close the connection when done.

>If I don't, with inactivity (over lunch, say), then the
>connection times out.

Raise your idle timers.

>How do I close a connection?

ldap_unbind()

>How do I test a connection?

Try any API call which generates a protocol request, like ldap_search().


>Protocol and other errors seem to cause segfaults.

You are mostly likely not using the API as directed.

>Should I catch
>SIGSEGV?

In general, no.

>Or is there a better way? For instance, ldap_search_s()
>segfaults far too often when talking to Exchange.

You are likely not using the API as directed.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic