Shutdown socket before close in ncclSocketClose()
This commit is contained in:
parent
5d3ab08b69
commit
367e9b61c3
@ -818,7 +818,10 @@ ncclResult_t ncclSocketTryRecv(struct ncclSocket* sock, void* ptr, int size, int
|
|||||||
|
|
||||||
ncclResult_t ncclSocketClose(struct ncclSocket* sock) {
|
ncclResult_t ncclSocketClose(struct ncclSocket* sock) {
|
||||||
if (sock != NULL) {
|
if (sock != NULL) {
|
||||||
if (sock->fd >= 0) close(sock->fd);
|
if (sock->fd >= 0) {
|
||||||
|
shutdown(sock->fd, SHUT_RDWR);
|
||||||
|
close(sock->fd);
|
||||||
|
}
|
||||||
sock->state = ncclSocketStateClosed;
|
sock->state = ncclSocketStateClosed;
|
||||||
sock->fd = -1;
|
sock->fd = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user