stream.resetStream([code])
告诉对端这一端不会再在这个流上发送更多数据,会发送一个携带 code 的 RESET_STREAM 帧。可读的一端保持打开,所以对端已经发送的数据仍然可以读取。
🌐 Tells the peer that this end will not send any more data on this stream,
sending a RESET_STREAM frame carrying code. The readable side is left
open, so data already sent by the peer remains available to read.
任何仍在等待发送的数据都会被丢弃。重置的流从不会被对端确认,所以出站队列无法再清空。
🌐 Any data still queued for sending is discarded. A reset stream is never acknowledged by the peer, so the outbound queue can no longer drain.
不会对这个操作提供任何确认。如果流已经被销毁、已经重置,或者是远程发起的单向流(没有可写的一方可以中止),这个调用不会有任何作用。
🌐 No acknowledgement of this action is provided. The call does nothing if the stream has been destroyed, if it has already been reset, or if it is a remote-initiated unidirectional stream, which has no writable side to abort.