LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-Oct-2009, 02:40 PM
Jim Willeke
NNTP User
 
Posts: n/a
Default Re: SocketTimeout behaviour

I think that is the expected behavior.

You can always do a search for something to keep it active.

Also, remember that the LDAP server may close an inactive connection
based on the server's timeout.

-jim

On 10/1/2009 11:16 AM, discolo wrote:
>
> Hi all,
> This is my first post and I've been looking for a response inside the
> class files, google and also this forum, but I haven't found a
> response.
>
> I'm using the this API for adding connection timeouts to my ldap
> connections. My question comes when I use the setSocketTimeout method or
> LDAPConnection(timeout) constructor.
> Inside the code, the setSocketTimeout method in the Connection class
> sets the SoTimeout for the Socket object.
> The setSoTimeout in the Java 1.4 API says "...a read() call on the
> InputStream associated with this Socket will block for only this amount
> of time. If the timeout expires, a java.net.SocketTimeoutException is
> raised, though the Socket is still valid..."
>
> So... I understand that I can hold the connection active if I'm not
> doing any read, or any search, delete, and so on. I have a connection
> pool and I need some active connections to be reused.
>
> And my problem starts here. If I open a new connection
> ....
> LDAPConnection ldapConnection = new LDAPConnection(timeout);
> ldapConnection.connect(host, port);
> ....
>
> If the connection remains idle over the requested timeout, the
> connection gets closed.
>
> The question is... żIs this a Bug or is the correct behaviour?
>
> Thanks in advance!
> Discolo
>
>

Reply With Quote
 

Tags
ldap, socket, sockettimeout, sotimeout, timeout

Thread Tools
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 08:04 PM.


İ 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2