[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: init, open, and close

You should probably just use the pointer value to determine if you're
connected or not.


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? If
> I re-run ldap_init() on each request, it works, but piles up open
> connections. If I don't, with inactivity (over lunch, say), then the
> connection times out.
> How do I close a connection?
> How do I test a connection?
> Protocol and other errors seem to cause segfaults. Should I catch
> SIGSEGV? Or is there a better way? For instance, ldap_search_s()
> segfaults far too often when talking to Exchange.
> Any help would be greatly appreciated! I've searched the archives, faqs,
> etc. and not found good answers...
> -M