gsk_secure_socket_close()
Closes a secure socket connection.
Format
#include <gskssl.h>
gsk_status gsk_secure_socket_close (
gsk_handle * soc_handle)
Parameters
- soc_handle
- Specifies the connection handle returned by the gsk_secure_socket_open() routine. The connection handle will be set to NULL upon completion.
Results
- [GSK_CONNECTION_ACTIVE]
- The connection has an active read or write request.
- [GSK_INVALID_HANDLE]
- The connection handle is not valid.
- [GSK_WOULD_BLOCK_WRITE]
- An attempt to write pending data failed with EWOULDBLOCK.
Usage
The gsk_secure_socket_close() routine closes a secure socket connection created by the gsk_secure_socket_open() routine. The socket itself is not closed (the application is responsible for closing the socket). The connection can no longer be used for secure communications after calling the gsk_secure_socket_close() routine.
The gsk_secure_socket_close() routine can return GSK_WOULD_BLOCK_WRITE if the socket is in non-blocking mode and there is pending write data. The connection is not closed in this case and the application should call gsk_secure_socket_close() again when the socket is ready to accept a write request.
Be sure gsk_secure_socket_shutdown() call is issued before a gsk_secure_socket_close() call.