On Thu, 5 Jan 2012 13:45:33 +0000 (GMT)
Nathan Smyth <naf...@ymail.com> wrote:

> Can you use the standard socket functions (i.e. poll/select) on a fd
> for a ssl connection?
>  I know you need to use the ssl_read/writes and other functions etc
>  to actually 'do stuff', but do the std socket state checking
>  functions work on a socket that has SSL initiated?

Funny you should mention. I just completed a little demo 
project that does exactly that. The short answer is 'yes'. 
You have to set your sockets to be nonblocking and *also* set 
your SSL connection objects nonblocking. Read or write the SSL 
objects until you get a 'waiting read' or 'waiting write' status, 
then add the associated socket to the appropriate fd_set and call 
select(). When you wake up, repeat the process. 

Let me know offlist if you'd like to see some sample code. 
It's kinda rough and ready but it works. 
 
-- 
--

Michael J. Smith
m...@smithbowen.net
 
Any proposition that seems self-evident 
is almost certainly false.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to