MCPcopy
hub / github.com/facebook/react / connectToSocket

Function connectToSocket

packages/react-devtools-core/src/standalone.js:282–298  ·  view source on GitHub ↗
(socket: WebSocket)

Source from the content-addressed store, hash-verified

280let startServerTimeoutID: TimeoutID | null = null;
281
282function connectToSocket(socket: WebSocket): {close(): void} {
283 socket.onerror = err => {
284 onDisconnected();
285 log.error('Error with websocket connection', err);
286 };
287 socket.onclose = () => {
288 onDisconnected();
289 log('Connection to RN closed');
290 };
291 initialize(socket);
292
293 return {
294 close: function () {
295 onDisconnected();
296 },
297 };
298}
299
300type ServerOptions = {
301 key?: string,

Callers

nothing calls this directly

Calls 4

onDisconnectedFunction · 0.85
logFunction · 0.70
initializeFunction · 0.70
errorMethod · 0.65

Tested by

no test coverage detected