HighTechTalks DotNet Forums  

DirectorySearcher maintains active TCP LDAP connection

Dotnet General Discussions microsoft.public.dotnet.general


Discuss DirectorySearcher maintains active TCP LDAP connection in the Dotnet General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
mcdonamw
 
Posts: n/a

Default DirectorySearcher maintains active TCP LDAP connection - 01-03-2008 , 12:02 AM






I am writing a little program in vb.net to return a collections of AD
properties to validate some information in AD. I'm noticing something
strange in that I cannot get my program to release the LDAP connection after
it's done doing what it needs to do. It will only close the connection when
the application is completely closed. I'm verifying the actual TCP
connection using TCPView from www.sysinternals.com.

As soon as I create the directorySearcher object (dirSearcher = new
directorySearcher(dirEntry)), the connection is made to my server.

I'm using a try, catch, finally block. In my finally section, I'm trying
dirEntry.close and dirSearcher.dispose, but the LDAP connection persists.
I've even gone as far as adding gc.collect to force a collection after I
close/dispose, but that had no effect either.

Am I missing something really easy here or is this a potential bug? I can't
see this as correct functionality as once an object is disposed/closed, the
connection it used should also close.

Further info: I use one directory entry, and one directory searcher object
based on the dirEntry. I do all my work from the actual search results
instead of creating additional dirEntries for each object returned in my
collection. This is strictly a directorySearch. I'm not doing any
additional functionality to the returned objects themselves, thus not
requiring the additional directory entries.

TIA!

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.