fix leaked client socket after receiving file

This commit is contained in:
2026-04-26 17:05:35 +03:00
parent 64b30e9835
commit 844093e3e7
4 changed files with 63 additions and 25 deletions
+3 -1
View File
@@ -2,6 +2,7 @@
#include "util.hpp"
#include "main.hpp"
#include <server.hpp>
#include <client.hpp>
#include <unistd.h>
static int nxlink_sock = -1;
@@ -22,7 +23,8 @@ extern "C" void userAppInit() {
extern "C" void userAppExit() {
cancelServerTransfer();
for (int i = 0; i < 150 && !isServerWorkersIdle(); i++) {
cancelClientTransfer();
for (int i = 0; i < 150 && (!isServerWorkersIdle() || !isClientWorkersIdle()); i++) {
usleep(10000);
}
if (nxlink_sock != -1) {