massively optimised reading from ssh, reduced cpu usage and energy usage

This commit is contained in:
neon443
2025-06-24 09:48:33 +01:00
parent 11a3db9307
commit 3f2c92cd91
3 changed files with 8 additions and 2 deletions

View File

@@ -342,7 +342,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
}
var buffer: [CChar] = Array(repeating: 0, count: 512)
let nbytes = ssh_channel_read(channel, &buffer, UInt32(buffer.count), 0)
let nbytes = ssh_channel_read_nonblocking(channel, &buffer, UInt32(buffer.count), 0)
guard nbytes > 0 else { return nil }