lib/tls.c
/** Check established TLS/DTLS channels for operation
 *
 * This function will check whether the channel(s) established
 * for TLS or DTLS are operational, and will re-establish the channel
 * if necessary. If this function fails then  the TLS or DTLS state 
 * should be considered as disconnected.
 * It must be called at a time when the sessions are not in usage
 * (e.g., in a different thread).
 *
 * Note: It is recommended to run this function periodically if you
 * have a DTLS channel since an undetected server reset may
 * result to a black hole behavior of the server.
 *
 * @param rh a handle to parsed configuration
 * @return 0 on success, -1 on error
 */
Check established TLS/DTLS channels for operation
This function will check whether the channel(s) established
for TLS or DTLS are operational, and will re-establish the channel
if necessary. If this function fails then  the TLS or DTLS state
should be considered as disconnected.
It must be called at a time when the sessions are not in usage
.

It is recommended to run this function periodically if you
have a DTLS channel since an undetected server reset may
result to a black hole behavior of the server.

@param rh a handle to parsed configuration
@return 0 on success, -1 on error
Check established TLS / DTLS channels for operation This function will check whether the channel ( s ) established for TLS or DTLS are operational and will re - establish the channel if necessary . If this function fails then the TLS or DTLS state should be considered as disconnected . It must be called at a time when the sessions are not in usage . It is recommended to run this function periodically if you have a DTLS channel since an undetected server reset may result to a black hole behavior of the server . @param rh a handle to parsed configuration @return 0 on success - 1 on error
int rc_check_tls(rc_handle * rh)
{
	tls_st *st;
	time_t now = time(0);
	int ret;
	if (rh->so_type != RC_SOCKET_TLS && rh->so_type != RC_SOCKET_DTLS)
		return 0;
	st = rh->so.ptr;
	if (st->ctx.init != 0) {
		if (st->ctx.need_restart != 0) {
			restart_session(rh, st);
		} else if (now - st->ctx.last_msg > TIME_ALIVE) {
			restart_session(rh, st);
			st->ctx.last_msg = now;
		}
	}
	return 0;
}
int rc_check_tls ( rc_handle * rh ) { tls_st * st ; time_t now = time ( 0 ) ; int ret ; if ( rh -> so_type != RC_SOCKET_TLS && rh -> so_type != RC_SOCKET_DTLS ) return 0 ; st = rh -> so . ptr ; if ( st -> ctx . init != 0 ) { if ( st -> ctx . need_restart != 0 ) { restart_session ( rh , st ) ; } else if ( now - st -> ctx . last_msg > TIME_ALIVE ) { restart_session ( rh , st ) ; st -> ctx . last_msg = now ; } } return 0 ; }
Check established TLS/DTLS channels for operation
 This function will check whether the channel(s) established
 for TLS or DTLS are operational, and will re-establish the channel
 if necessary.
Check established TLS / DTLS channels for operation This function will check whether the channel ( s ) established for TLS or DTLS are operational and will re - establish the channel if necessary .