These functions are affected by the use of non-blocking sockets
with SSL.
- gsk_secure_socket_init()
- During the SSL handshake, the io_setsocketoptions() routine
is called by the gsk_secure_socket_init() routine before initiating
the SSL handshake (GSK_SET_SOCKET_STATE_FOR_HANDSHAKE) and again upon
completion of the SSL handshake (GSK_SET_SOCKET_STATE_FOR_READ_WRITE).
The default io_setsocketoptions() routine puts the socket into
blocking mode for GSK_SET_SOCKET_STATE_FOR_HANDSHAKE and restores
the original mode for GSK_SET_SOCKET_STATE_FOR_READ_WRITE. In order
to perform a non-blocking SSL handshake, an application supplied io_setsocketoptions() callback
must be provided to control the state of the socket. When the socket
is in non-blocking mode, gsk_secure_socket_init() may return
GSK_WOULD_BLOCK_READ or GSK_WOULD_BLOCK_WRITE. This error indicates
that System SSL was unable to read or write the entire message. When
this occurs, the application should call select() and then
call gsk_secure_socket_init() again.
- gsk_secure_socket_read()
- Once the socket is configured as non-blocking, any calls to gsk_secure_socket_read() can
potentially return GSK_WOULD_BLOCK. When this occurs, the application
should call select() and then call gsk_secure_socket_read() again.
- gsk_secure_socket_write()
- Once the socket is configured as non-blocking, any calls to gsk_secure_socket_write() can
potentially return GSK_WOULD_BLOCK. When this occurs, the application
should call select() and then call gsk_secure_socket_write() again.