Skip to content

Commit

Permalink
fix(server): allow skipping init message wait with zero values
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Aug 27, 2020
1 parent 5672a04 commit a7419df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server.ts
Expand Up @@ -94,7 +94,7 @@ export interface ServerOptions {
* The amount of time for which the
* server will wait for `ConnectionInit` message.
*
* Set the value to `Infinity` to skip waiting.
* Set the value to `Infinity`, '', 0, null or undefined to skip waiting.
*
* If the wait timeout has passed and the client
* has not sent the `ConnectionInit` message,
Expand Down Expand Up @@ -227,6 +227,7 @@ export function createServer(
// kick the client off (close socket) if the connection has
// not been initialised after the specified wait timeout
const connectionInitWait =
connectionInitWaitTimeout && // even 0 disables it
connectionInitWaitTimeout !== Infinity &&
setTimeout(() => {
if (!ctxRef.current.connectionInitReceived) {
Expand Down

0 comments on commit a7419df

Please sign in to comment.