Skip to content

Commit d3bf695

Browse files
authored
🤖 Merge PR DefinitelyTyped#72329 [ssh2] Typing update to add client.setNoDelay by @JeanDamien
1 parent 5ae96c0 commit d3bf695

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

‎types/ssh2/index.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ export class Client extends EventEmitter {
697697
* the server.
698698
*/
699699
openssh_forwardOutStreamLocal(socketPath: string, cb: ClientCallback): this;
700+
701+
/**
702+
* Calls setNoDelay() on the underlying socket. Disabling Nagle's algorithm improves latency at the expense of lower throughput.
703+
*/
704+
setNoDelay(noDelay?: boolean): this;
700705
}
701706

702707
export type HostVerifier = (key: Buffer, verify: VerifyCallback) => void;

‎types/ssh2/ssh2-tests.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ const sshconfig: ssh2.ConnectConfig = {
342342
},
343343
};
344344

345+
// setNoDelay
346+
var Client = require("ssh2").Client;
347+
var conn = new Client().setNoDelay(true);
348+
345349
//
346350
// # Server Examples
347351
//

0 commit comments

Comments
 (0)