MCPcopy Create free account
hub / github.com/CommE2E/comm / sendPing

Method sendPing

lib/socket/socket.react.js:766–785  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

764 }
765
766 async sendPing() {
767 if (this.props.connection.status !== 'connected') {
768 // This generally shouldn't happen because anything that changes the
769 // connection status should call stopPing(), but it's good to make sure
770 return;
771 }
772 const messageID = this.sendMessageWithoutID({
773 type: clientSocketMessageTypes.PING,
774 });
775 try {
776 invariant(
777 this.state.inflightRequests,
778 'inflightRequests falsey inside sendPing',
779 );
780 await this.state.inflightRequests.fetchResponse<PongServerSocketMessage>(
781 messageID,
782 serverSocketMessageTypes.PONG,
783 );
784 } catch (e) {}
785 }
786
787 setLateResponse: (messageID: number, isLate: boolean) => void = (
788 messageID,

Callers 1

resetPingMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected