(socket: WebSocket)
| 280 | let startServerTimeoutID: TimeoutID | null = null; |
| 281 | |
| 282 | function 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 | |
| 300 | type ServerOptions = { |
| 301 | key?: string, |
nothing calls this directly
no test coverage detected