Skip to content

Commit

Permalink
Enable TCP NODELAY on Deno (#665)
Browse files Browse the repository at this point in the history
* Enable TCP NODELAY on Deno

* PR link
  • Loading branch information
tomaka authored Jun 7, 2023
1 parent 5dfc3ed commit 0a49f28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- A `validated` event is now properly generated when watching a transaction using `transaction_unstable_submitAndWatch`. ([#676](https://github.com/smol-dot/smoldot/pull/676))
- Fix `author_submitAndWatchExtrinsic` erroneously generating `transaction_unstable_watchEvent` notifications, and `transaction_unstable_submitAndWatch` erroneously generating `author_extrinsicUpdate` notifications. ([#677](https://github.com/smol-dot/smoldot/pull/677))

### Changed

- TCP NODELAY is now enabled on Deno. The minimum required Deno version is now v1.29.0, which was released on 2022-12-14. ([#665](https://github.com/smol-dot/smoldot/pull/665))

## 1.0.8 - 2023-06-05

### Changed
Expand Down
19 changes: 7 additions & 12 deletions wasm-node/javascript/src/no-auto-bytecode-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ function connect(config: ConnectionConfig): Connection {
};

socket.inner = socket.inner.then((established) => {
// TODO: at the time of writing of this comment, `setNoDelay` is still unstable
//established.setNoDelay();

if (socket.destroyed)
return established;

established?.setNoDelay();
config.onOpen({ type: 'single-stream', handshake: 'multistream-select-noise-yamux', initialWritableBytes: 1024 * 1024, writeClosable: true });

// Spawns an asynchronous task that continuously reads from the socket.
Expand Down Expand Up @@ -396,16 +395,12 @@ declare namespace Deno {

export interface TcpConn extends Conn {
/**
* **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617.
*
* Enable/disable the use of Nagle's algorithm. Defaults to true.
*/
setNoDelay(nodelay?: boolean): void;
/**
* **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617.
* Enable/disable the use of Nagle's algorithm.
*
* Enable/disable keep-alive functionality.
* @param [noDelay=true]
*/
setKeepAlive(keepalive?: boolean): void;
setNoDelay(noDelay?: boolean): void;
/** Enable/disable keep-alive functionality. */
setKeepAlive(keepAlive?: boolean): void;
}
}

0 comments on commit 0a49f28

Please sign in to comment.