Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
quic: allow .connect() when socket is already bound
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Oct 16, 2019
1 parent bbd5631 commit 9cdf8d9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/internal/quic/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,13 +910,18 @@ class QuicSocket extends EventEmitter {
if (typeof callback === 'function')
session.on('ready', callback);

this[kMaybeBind](
connectAfterBind.bind(
this,
session,
this.#lookup,
address,
getSocketType(type)));
const afterBind =
connectAfterBind.bind(
this,
session,
this.#lookup,
address,
getSocketType(type));
if (this.#state === kSocketBound) {
afterBind();
} else {
this[kMaybeBind](afterBind);
}

return session;
}
Expand Down

0 comments on commit 9cdf8d9

Please sign in to comment.