On 1/5/2012 3:42 PM, Jakob Bohm wrote:
On 1/5/2012 2:45 PM, Nathan Smyth wrote:
Quick question.

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?


On UNIX/POSIX/Linux/BSD/MacOSX/AppleIOS: Yes.
On DOS/Windows/OS2: No
On BEOS/SymbianOpenC/MacClassic/Other: Don't know

Clarification: The above answer was for the ability to use
those functions on non-socket fds (such as named pipes,
files, etc.), similar to the ability to *sometimes* use
WaitFor**Object*() function on Win32 sockets.

As for using select() etc. on a socket also used with OpenSSL,
this should not be a problem on any OS with reasonable
implementations of those calls, just follow the general rules
about when to wait for what socket condition depending on the
return values from OpenSSL.

Pay special attention to the fact that sometimes an OpenSSL
call to send or recv will ask you to wait (select) for it's own
direction to be ready, sometimes for the other direction to be
ready, depending on internal OpenSSL states.  Other threads
on this list have many more details than I can give you.

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

Reply via email to