Skip to content

stream_write 与 stream_read 接口的问题 #207

Closed Answered by iyangsj
stopandjoin asked this question in Q&A (问题和回答)
Discussion options

You must be logged in to vote
  1. 可以多次执行写操作后,再执行后置处理 quic_endpoint_process_connections
    建议仅在回调函数中(例如writable回调中)执行写操作,这样不必每次显式调用后置处理;同时库会在批量读写操作完成后,才执行后置处理,效率更高

  2. stream_write有可能实际写入数据,少于提供的数据,应等待 writeable回调再次尝试写入

  3. 同上,应等待readable回调再次尝试读取

  4. quic_stream_wantwrite用于暂时关闭或启用可写事件通知
    例如:当QUIC流可写而应用层暂时无数据需要写入时,可以暂时屏蔽可写事件,避免无用的回调通知

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@stopandjoin
Comment options

@iyangsj
Comment options

@stopandjoin
Comment options

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