(event: CloseEvent)
| 127 | } |
| 128 | |
| 129 | onclose(event: CloseEvent) { |
| 130 | // console.log("close", event); |
| 131 | if (this.onOpenTimeoutId) { |
| 132 | clearTimeout(this.onOpenTimeoutId); |
| 133 | } |
| 134 | if (event.wasClean) { |
| 135 | dlog("connection closed"); |
| 136 | } else { |
| 137 | dlog("connection error/disconnected"); |
| 138 | } |
| 139 | if (this.open || this.opening) { |
| 140 | this.open = false; |
| 141 | this.opening = false; |
| 142 | this.reconnect(); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | onopen(e: Event) { |
| 147 | dlog("connection open"); |