(clientImplementation: any)
| 32 | public connectionStatusChanged = new TypedEvent<{connected:boolean}>(); |
| 33 | |
| 34 | constructor(clientImplementation: any) { |
| 35 | super(); |
| 36 | this.socket = io.connect(origin); |
| 37 | |
| 38 | // Also provide the following services to the server |
| 39 | this.registerAllFunctionsExportedFromAsResponders(clientImplementation); |
| 40 | this.startListening(); |
| 41 | |
| 42 | this.socket.on(anycastMessageName,(msg:CastMessage<any>)=>{ |
| 43 | this.typedEvents[msg.message].emit(msg.data); |
| 44 | }); |
| 45 | |
| 46 | let connected = false; |
| 47 | setInterval(() => { |
| 48 | let newConnected = this.socket.connected; |
| 49 | if (newConnected != connected) { |
| 50 | connected = newConnected; |
| 51 | this.connectionStatusChanged.emit({ connected }); |
| 52 | } |
| 53 | }, 2000); |
| 54 | } |
| 55 | |
| 56 | private typedEvents:{[key:string]:TypedEvent<any>} = {}; |
| 57 |
nothing calls this directly
no test coverage detected