-
API doc said that StreamSend just enqueue data on stream and it is unblocking call. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can call shutdown while there is still data in flight, as long as it's not an abortive shutdown. that will just shut down the send side, you can still receive data. Then you can wait for the ShutdownComplete callback, and close once you receive that. |
Beta Was this translation helpful? Give feedback.
-
My code example is bellow. void close(Stream, Connection, Configuration, Registration) {
if (Stream) {
MsQuic->StreamShutdown(Stream, QUIC_STREAM_SHUTDOWN_FLAG_GRACEFUL, 0);
}
//sleep(1);
if (Connection) {
MsQuic->ConnectionShutdown(Connection, QUIC_CONNECTION_SHUTDOWN_FLAG_NONE, 0);
}
if (Configuration) {
MsQuic->ConfigurationClose(Configuration);
}
if (Registration) {
MsQuic->RegistrationShutdown(Registration, QUIC_CONNECTION_SHUTDOWN_FLAG_NONE, 0);
}
} |
Beta Was this translation helpful? Give feedback.
You can call shutdown while there is still data in flight, as long as it's not an abortive shutdown. that will just shut down the send side, you can still receive data. Then you can wait for the ShutdownComplete callback, and close once you receive that.