Re: Set Time out for SSL read

2010-10-02 Thread David Schwartz

On 9/30/2010 11:39 PM, Raj wrote:


Can you please let me know how can I set time out as a whole. I think
you are mentioning about SSL_CTX_Set_timeout function. If it is so then
I have set the time out using this function, and sadly I didn't get the
expected result.


There are a lot of ways. The most common is 'alarm'. Your platform may 
also have a particular way of timing out TCP connections such as through 
a 'setsockopt'. This is an ugly method and, IMO, is only appropriate in 
a program that needs to terminate if the connection is lost.


DS

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Set Time out for SSL read

2010-10-01 Thread Raj

Hi
 Thank you so much for your reply
 Can you please let me know how can I set time out as a whole. I think you 
are mentioning about SSL_CTX_Set_timeout function. If it is so then I have 
set the time out using this function, and sadly I didn't get the expected 
result.


Thanks,
Raj
Rajmohan SK

- Original Message - 
From: David Schwartz dav...@webmaster.com

To: openssl-users@openssl.org
Sent: Thursday, September 30, 2010 6:09 PM
Subject: Re: Set Time out for SSL read



On 9/29/2010 11:41 PM, Raj wrote:


Hi All
Is there any method to set time our for SSL _read function.
As from the Open SSL document SSL_read will not return if there is no
data to read from the socket


You really shouldn't need this. If you know for sure that it's the other 
side's turn to transmit, you should be timing out the connection (or even 
application) as a whole, not just the read. If you don't know for sure 
that it's the other side's turn to transmit, you should not be making a 
blocking call to SSL_read.


In any event, I recommend that you basically never use blocking functions.

DS

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org




__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Set Time out for SSL read

2010-09-30 Thread Raj
Hi All
Is there any method to set time our for SSL _read function.
As from the Open SSL document SSL_read will not return if there is no data 
to read from the socket 

Thanks, 
Raj 
Rajmohan SK 

Re: Set Time out for SSL read

2010-09-30 Thread David Schwartz

On 9/29/2010 11:41 PM, Raj wrote:


Hi All
Is there any method to set time our for SSL _read function.
As from the Open SSL document SSL_read will not return if there is no
data to read from the socket


You really shouldn't need this. If you know for sure that it's the other 
side's turn to transmit, you should be timing out the connection (or 
even application) as a whole, not just the read. If you don't know for 
sure that it's the other side's turn to transmit, you should not be 
making a blocking call to SSL_read.


In any event, I recommend that you basically never use blocking functions.

DS

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org