Skip to content

Optimizing MSQuic Large File Transfer Efficiency While Preventing Buffer Overflow #4908

Answered by guhetier
lion117 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
There is some documentation to help you here: https://github.com/microsoft/msquic/blob/main/docs/Streams.md#sending
This sample should also help: https://github.com/microsoft/msquic/blob/main/src/tools/post/post.cpp

To get you started, the important bits are:

  • create an event SendReady
  • add a handler for QUIC_STREAM_EVENT_SEND_COMPLETE
    • in this handler, trigger SendReady
    • it means the previous "send" operation was completed by MsQuic, and you can send more data
  • in your send loop:
    • call StreamSend with some data
    • wait on SendReady
    • reset SendReady
    • loop around to send the next chunk

Note that MsQuic notifies QUIC_STREAM_EVENT_SEND_COMPLETE as soon as it is ready for you to give more da…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@lion117
Comment options

Comment options

You must be logged in to vote
2 replies
@guhetier
Comment options

Answer selected by lion117
@nibanks
Comment options

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