mirror of
https://github.com/neon443/ShhShell.git
synced 2026-11-30 12:44:51 +00:00
massively optimised reading from ssh, reduced cpu usage and energy usage
This commit is contained in:
3 files changed
+8
-2
No files matched your search
@@ -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 }
|
||||
|
||||
|
||||