kill socket in esl_disconnect to prevent blocking
This commit is contained in:
parent
2f1c82ff36
commit
634d936a02
|
@ -1123,6 +1123,12 @@ ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle)
|
|||
return ESL_FAIL;
|
||||
}
|
||||
|
||||
if (handle->sock != ESL_SOCK_INVALID) {
|
||||
closesocket(handle->sock);
|
||||
handle->sock = ESL_SOCK_INVALID;
|
||||
status = ESL_SUCCESS;
|
||||
}
|
||||
|
||||
if (mutex) {
|
||||
esl_mutex_lock(mutex);
|
||||
}
|
||||
|
@ -1145,12 +1151,6 @@ ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle)
|
|||
esl_event_safe_destroy(&handle->last_ievent);
|
||||
esl_event_safe_destroy(&handle->info_event);
|
||||
|
||||
if (handle->sock != ESL_SOCK_INVALID) {
|
||||
closesocket(handle->sock);
|
||||
handle->sock = ESL_SOCK_INVALID;
|
||||
status = ESL_SUCCESS;
|
||||
}
|
||||
|
||||
if (mutex) {
|
||||
esl_mutex_unlock(mutex);
|
||||
esl_mutex_lock(mutex);
|
||||
|
|
Loading…
Reference in New Issue