(data: WSCommandType)
| 204 | } |
| 205 | |
| 206 | sendMessage(data: WSCommandType) { |
| 207 | if (!this.open) { |
| 208 | return; |
| 209 | } |
| 210 | const msg = JSON.stringify(data); |
| 211 | const byteSize = new Blob([msg]).size; |
| 212 | if (byteSize > MaxWebSocketSendSize) { |
| 213 | console.log("ws message too large", byteSize, data.wscommand, msg.substring(0, 100)); |
| 214 | return; |
| 215 | } |
| 216 | if (byteSize > WarnWebSocketSendSize) { |
| 217 | console.log("ws message large", byteSize, data.wscommand, msg.substring(0, 100)); |
| 218 | } |
| 219 | this.wsConn.send(msg); |
| 220 | } |
| 221 | |
| 222 | pushMessage(data: WSCommandType) { |
| 223 | if (!this.open) { |
no outgoing calls
no test coverage detected