www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


SSL_HandshakeComplete

Check handshake status.

int SSL_HandshakeComplete(int sd,
                         unsigned int timeout);

Parameters

sd

Socket descriptor

timeout

Block period in milliseconds:
    0xFFFF for block forever
    0 for no blocking (polling)
    1 through 65534 milliseconds maximum wait.

Return Value

status:
    -3:   Handshake failure
    -2:   Invalid socket descriptor
    -1:   Not a TCP type socket
    0:   Either not an SSL type socket or handshake in progress
    1:   SSL handshake completed

Comments

Use of this function is optional.   It allows the user to determine whether or not the SSL handshake process has completed and that the data socket is now ready for data transmission and reception of user data.

This API can be used in either polling mode (timeout = 0) or blocking mode.   Blocking mode will return as soon as the status indication return value is non-zero, or the specified time-out period has elapsed.   The timeout parameter may be set to 0xFFFF to block for an indefinite amount of time, in which case the return value is guaranteed to be non-zero on return.

Alternatively, the user can simply make repeated calls to the send() and/or recv() functions until this handshake is completed.   The SSL handshake is performed in the user's thread, so one of these three functions must be called in order to complete the SSL connection.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV1.10V1.00

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.07

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document