Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
fix: bind socket methods in websocket connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bradennapier committed Mar 12, 2019
1 parent a1d0ffe commit 2f5fd16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/datastream-connection/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ export default function createConnection(
}
const ms = redelay.next();
if (config.log && ms > 0) {
console.log(ms);
console.info(
`[RECONNECT] | DatastreamConnection | Reconnecting to the Datastream after ${Math.round(
ms / 1000
Expand Down
6 changes: 3 additions & 3 deletions packages/datastream-connector-uws/src/ws-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default function createDatastreamConnector(
cb(err);
}
},
ping: socket.ping,
close: socket.close,
terminate: socket.terminate,
ping: socket.ping.bind(socket),
close: socket.close.bind(socket),
terminate: socket.terminate.bind(socket),
};
}
6 changes: 3 additions & 3 deletions packages/datastream-connector-ws/src/ws-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default function createDatastreamConnector(
cb(err);
}
},
ping: socket.ping,
close: socket.close,
terminate: socket.terminate,
ping: socket.ping.bind(socket),
close: socket.close.bind(socket),
terminate: socket.terminate.bind(socket),
};
}

0 comments on commit 2f5fd16

Please sign in to comment.