(item, cb, hint)
| 18180 | const closeFrame = new WebsocketFrameSend(body2); |
| 18181 | this.ws[kResponse].socket.write( |
| 18182 | closeFrame.createFrame(opcodes.CLOSE), |
| 18183 | (err) => { |
| 18184 | if (!err) { |
| 18185 | this.ws[kSentClose] = sentCloseFrameState.SENT; |
| 18186 | } |
| 18187 | } |
| 18188 | ); |
| 18189 | } |
| 18190 | this.ws[kReadyState] = states.CLOSING; |
| 18191 | this.ws[kReceivedClose] = true; |
| 18192 | return false; |
| 18193 | } else if (opcode === opcodes.PING) { |
| 18194 | if (!this.ws[kReceivedClose]) { |
| 18195 | const frame = new WebsocketFrameSend(body); |
| 18196 | this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)); |
| 18197 | if (channels.ping.hasSubscribers) { |
| 18198 | channels.ping.publish({ |
| 18199 | payload: body |
| 18200 | }); |
| 18201 | } |
| 18202 | } |
| 18203 | } else if (opcode === opcodes.PONG) { |
| 18204 | if (channels.pong.hasSubscribers) { |
| 18205 | channels.pong.publish({ |
| 18206 | payload: body |
| 18207 | }); |
| 18208 | } |
| 18209 | } |
| 18210 | return true; |
| 18211 | } |
| 18212 | get closingInfo() { |
no test coverage detected