mbed-os5 only for TYBLE16
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
Diff: features/mbedtls/src/net_sockets.c
- Revision:
- 1:9db0e321a9f4
- Parent:
- 0:5b88d5760320
--- a/features/mbedtls/src/net_sockets.c Tue Dec 17 23:23:45 2019 +0000 +++ b/features/mbedtls/src/net_sockets.c Tue Dec 31 06:02:27 2019 +0000 @@ -284,7 +284,7 @@ int err = errno; /* - * Never return 'WOULD BLOCK' on a non-blocking socket + * Never return 'WOULD BLOCK' on a blocking socket */ if( ( fcntl( ctx->fd, F_GETFL ) & O_NONBLOCK ) != O_NONBLOCK ) { @@ -652,6 +652,19 @@ } /* + * Close the connection + */ +void mbedtls_net_close( mbedtls_net_context *ctx ) +{ + if( ctx->fd == -1 ) + return; + + close( ctx->fd ); + + ctx->fd = -1; +} + +/* * Gracefully close the connection */ void mbedtls_net_free( mbedtls_net_context *ctx )