z/OS Cryptographic Services System SSL Programming
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


gsk_secure_socket_close()

z/OS Cryptographic Services System SSL Programming
SC14-7495-00

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

The function return value will be 0 (GSK_OK) if no error is detected. Otherwise, it will be one of the return codes listed in the gskssl.h include file. These are some possible errors:
[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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014