diff --git a/src/peer_signaling.c b/src/peer_signaling.c index bd0fa53..822a069 100644 --- a/src/peer_signaling.c +++ b/src/peer_signaling.c @@ -471,6 +471,8 @@ void peer_signaling_leave_channel() { if (status != MQTTSuccess) { LOGE("Failed to disconnect with broker: %s", MQTT_Status_strerror(status)); } + + ssl_transport_disconnect(&g_ps.net_ctx); } } diff --git a/src/sctp.c b/src/sctp.c index 76ebeaa..c59a300 100644 --- a/src/sctp.c +++ b/src/sctp.c @@ -576,6 +576,7 @@ void sctp_destroy_socket(Sctp* sctp) { if (sctp && sctp->sock) { usrsctp_shutdown(sctp->sock, SHUT_RDWR); usrsctp_close(sctp->sock); + usrsctp_finish(); sctp->sock = NULL; } #endif