diff --git a/Sources/Packages/Sources/SecretAgentKit/SocketController.swift b/Sources/Packages/Sources/SecretAgentKit/SocketController.swift index 2f5e79e..ed4b9d2 100644 --- a/Sources/Packages/Sources/SecretAgentKit/SocketController.swift +++ b/Sources/Packages/Sources/SecretAgentKit/SocketController.swift @@ -22,6 +22,7 @@ public struct Session: Sendable { guard !data.isEmpty else { logger.debug("Socket controller received empty data, ending continuation.") continuation.finish() + try fileHandle.close() return } continuation.yield(data) @@ -37,6 +38,7 @@ public struct Session: Sendable { public func close() throws { logger.debug("Session closed.") + continuation.finish() try fileHandle.close() }