| 1395 | } |
| 1396 | |
| 1397 | function onSocketResume() { |
| 1398 | // It may seem that the socket is resumed, but this is an enemy's trick to |
| 1399 | // deceive us! `resume` is emitted asynchronously, and may be called from |
| 1400 | // `incoming.readStart()`. Stop the socket again here, just to preserve the |
| 1401 | // state. |
| 1402 | // |
| 1403 | // We don't care about stream semantics for the consumed socket anyway. |
| 1404 | if (this._paused) { |
| 1405 | this.pause(); |
| 1406 | return; |
| 1407 | } |
| 1408 | |
| 1409 | if (this._handle && !this._handle.reading) { |
| 1410 | this._handle.reading = true; |
| 1411 | this._handle.readStart(); |
| 1412 | } |
| 1413 | } |
| 1414 | |
| 1415 | function onSocketPause() { |
| 1416 | if (this._handle?.reading) { |