diff --git a/src/main/java/com/superzanti/serversync/server/ServerWorker.java b/src/main/java/com/superzanti/serversync/server/ServerWorker.java index b36ece8..dfb1c6a 100644 --- a/src/main/java/com/superzanti/serversync/server/ServerWorker.java +++ b/src/main/java/com/superzanti/serversync/server/ServerWorker.java @@ -298,6 +298,7 @@ private void transferFile(Path file) throws IOException { try (BufferedInputStream fis = new BufferedInputStream(Files.newInputStream(file), SyncConfig.getConfig().BUFFER_SIZE)) { while ((bytesRead = fis.read(buffer)) > 0) { os.write(buffer, 0, bytesRead); + setTimeout(FILE_SYNC_CLIENT_TIMEOUT_MS); } } catch (IOException e) { clientLogger.debug(String.format("Failed to write file: %s", file));