* Start monitoring the RTMClient. This method should only be called after the client's websocket is already open.
(client: RTMClient)
| 99 | * Start monitoring the RTMClient. This method should only be called after the client's websocket is already open. |
| 100 | */ |
| 101 | public start(client: RTMClient): void { |
| 102 | this.logger.debug('start monitoring'); |
| 103 | |
| 104 | if (!client.connected) { |
| 105 | const error = new Error(''); |
| 106 | (error as CodedError).code = ErrorCode.KeepAliveClientNotConnected; |
| 107 | throw error; |
| 108 | } |
| 109 | |
| 110 | this.client = client; |
| 111 | this.isMonitoring = true; |
| 112 | this.client.on('outgoing_message', this.setPingTimer, this); |
| 113 | this.setPingTimer(); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Stop monitoring the RTMClient. This method should be called after the `recommend_reconnect` event is emitted and |
no test coverage detected