Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

threads in fileserver..

roryclear9c5b453975e8
diff --git a/clearcam/FileServer.m b/clearcam/FileServer.m
index 9554b6e..1f6680a 100644
--- a/clearcam/FileServer.m
+++ b/clearcam/FileServer.m
@@ -59,8 +59,11 @@
int clientSocket = accept(serverSocket, NULL, NULL);
if (clientSocket == -1) continue;
- [self handleClientRequest:clientSocket withBasePath:basePath];
- close(clientSocket);
+ // Create a new thread or dispatch queue for each client connection
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ [self handleClientRequest:clientSocket withBasePath:basePath];
+ close(clientSocket);
+ });
}
} @catch (NSException *exception) {