问下在并发模型中连接协程到流协程分出来的是什么? #837
Answered
by
iyangsj
zyong
asked this question in
Q&A (问题和回答)
-
你好,问下就是连接协程到流协程,发送过去的是具体单个流的处理逻辑还是什么别的?然后怎么控制连接的close呢? |
Beta Was this translation helpful? Give feedback.
Answered by
iyangsj
Sep 22, 2021
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mileszhang2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在HTTP2/SPDY连接中,每个流的请求及响应的处理,是在单独的流协程执行
参见:https://github.com/bfenetworks/bfe/blob/develop/bfe_http2/server.go#L1817
连接关闭时,连接协程在退出前将更新流的状态;相关的流协程在执行请求读取或响应发送操作,将出现IO错误并结束处理
参见:https://github.com/bfenetworks/bfe/blob/develop/bfe_spdy/server_conn.go#L790