Shutdown socket before close in ncclSocketClose()

这个提交包含在:
Kaiming Ouyang 于 2023-04-13 09:11:52 -07:00 提交
1 父节点 5d3ab08b69
当前提交 367e9b61c3
1 个文件已更改
+4 -1
+4 -1
查看文件
@@ -818,7 +818,10 @@ ncclResult_t ncclSocketTryRecv(struct ncclSocket* sock, void* ptr, int size, int
ncclResult_t ncclSocketClose(struct ncclSocket* sock) {
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->fd = -1;
}