LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-Oct-2009, 10:11 AM
Junior Member
 
Join Date: Oct 2009
Posts: 2
discolo 0 reputation points
Default SocketTimeout behaviour

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 09:33 PM.


İ 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2