Skip to content

关于 socketchannel 的 padding 模式有些疑问 #1396

Answered by cloudwu
t0350 asked this question in Q&A
Discussion options

You must be logged in to vote

对的。这里用 lwrite 有问题,不仅仅是 response 乱序的问题。而是 padding 是分次发送的,可能和正常 write 交错。

不过上面的例子反而不会出问题。因为,同一个coroutine 发 request 会等待 response 后才发下一个。

出问题应该是在多 coroutine 交错使用 padding 和无 padding 的情况。

明天我改成用 write 。

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@cloudwu
Comment options

@t0350
Comment options

@cloudwu
Comment options

@t0350
Comment options

@cloudwu
Comment options

Answer selected by t0350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants