(sock)
| 213 | handleData(adapter, st, data, wsUrl, authHeader, wsAuthHeader) |
| 214 | }, |
| 215 | drain(sock) { |
| 216 | const st = sock.data |
| 217 | while (st.writeBuf.length > 0) { |
| 218 | const chunk = st.writeBuf[0]! |
| 219 | const n = sock.write(chunk) |
| 220 | if (n < chunk.length) { |
| 221 | st.writeBuf[0] = chunk.subarray(n) |
| 222 | return |
| 223 | } |
| 224 | st.writeBuf.shift() |
| 225 | } |
| 226 | }, |
| 227 | close(sock) { |
| 228 | cleanupConn(sock.data) |
| 229 | }, |