What conditions cause NetworkStream.Write to block?

后端 未结 3 1686
隐瞒了意图╮
隐瞒了意图╮ 2020-12-18 00:13

Will NetworkStream.Write block only until it places the data to be sent into the TCP send buffer, or will it block until the data is actually ACK\'d by the rece

3条回答
  •  不知归路
    2020-12-18 00:27

    I disagree with both answers [that state it blocks]. Writing to TCP/IP socket does not block unless the underlying buffer is already full of unacknowledge data. Generally, it doesn't block but just gets handed off to the TCP implementation. But of course now I have to go track down some references to back this up :)

    From SO

提交回复
热议问题