From 0da748556bc24ec972dd27afc840e6d63b661b2e Mon Sep 17 00:00:00 2001 From: Huan LI Date: Tue, 20 Mar 2018 05:45:50 +0800 Subject: [PATCH] change default keep-alive setting on the client from 10s to 30s (#368) --- CHANGELOG.md | 1 + README.md | 2 +- src/defaults.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9cdb117..9c5c80de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### vNEXT +- change default timeout from 10s to 30s [PR #368](https://github.com/apollographql/subscriptions-transport-ws/pull/368) - pass `request` (`upgradeReq`) to `ConnectionContext` [PR #369](https://github.com/apollographql/subscriptions-transport-ws/pull/369) - pass `ConnectionContext` to `onDisconnect()` as second argument [PR #369](https://github.com/apollographql/subscriptions-transport-ws/pull/369) diff --git a/README.md b/README.md index d277ff9a1..78aa3e65e 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ ReactDOM.render( ### `Constructor(url, options, connectionCallback)` - `url: string` : url that the client will connect to, starts with `ws://` or `wss://` - `options?: Object` : optional, object to modify default client behavior - * `timeout?: number` : how long the client should wait in ms for a keep-alive message from the server (default 10000 ms), this parameter is ignored if the server does not send keep-alive messages. This will also be used to calculate the max connection time per connect/reconnect + * `timeout?: number` : how long the client should wait in ms for a keep-alive message from the server (default 30000 ms), this parameter is ignored if the server does not send keep-alive messages. This will also be used to calculate the max connection time per connect/reconnect * `lazy?: boolean` : use to set lazy mode - connects only when first subscription created, and delay the socket initialization * `connectionParams?: Object | Function` : object that will be available as first argument of `onConnect` (in server side), if passed a function - it will call it and send the return value * `reconnect?: boolean` : automatic reconnect in case of connection error diff --git a/src/defaults.ts b/src/defaults.ts index abf60e860..b1ec67817 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -1,4 +1,4 @@ -const WS_TIMEOUT = 10000; +const WS_TIMEOUT = 30000; export { WS_TIMEOUT,