Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot receive message in stream_callback on server #4147

Open
1 of 4 tasks
lauix opened this issue Feb 21, 2024 · 1 comment
Open
1 of 4 tasks

Cannot receive message in stream_callback on server #4147

lauix opened this issue Feb 21, 2024 · 1 comment
Labels
external Proposed by non-MSFT question Further information is requested
Milestone

Comments

@lauix
Copy link

lauix commented Feb 21, 2024

Describe the bug

client send a query request to server. when server received the request in the stream_callback function(event is QUIC_STREAM_EVENT_RECEIVE) , I used StreamSend function to send the response data to the client in the stream_callback function, and then the server-side donnot receive any requests.

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

No response

MsQuic version

main

Steps taken to reproduce bug

QUIC_STATUS msquic_stream_callback(HQUIC strm, void *context, QUIC_STREAM_EVENT *event) {
QUIC_STATUS status = QUIC_STATUS_SUCCESS;

sample_comm_msquic_context *ctx = (sample_comm_msquic_context *)context;
sample_comm_msquic_share_info *msquic_share_info = (sample_comm_msquic_share_info *)ctx->user_data;

switch (event->Type) {
case QUIC_STREAM_EVENT_SEND_COMPLETE: {
    free(event->SEND_COMPLETE.ClientContext);
} break;
case QUIC_STREAM_EVENT_RECEIVE: {

     // build response data

     if (QUIC_FAILED(status = msquic_share_info->msquic_handle->api->StreamSend(strm, send_Buffer, 1, QUIC_SEND_FLAG_ALLOW_0_RTT, send_Buffer))) {
                sample_print("StreamSend failed, 0x%x!\n", status);
                free(send_buffer_raw);
      }
} break;

Expected behavior

can send data in stream_callback function on server-side

Actual outcome

none

Additional details

No response

@nibanks nibanks added this to the Future milestone Feb 21, 2024
@nibanks nibanks added question Further information is requested external Proposed by non-MSFT labels Feb 21, 2024
@nibanks
Copy link
Member

nibanks commented Feb 21, 2024

Expected Behavior

can send data in stream_callback function on server-side

You absolutely can send in any callback. I suggest you grab logs to diagnose what's going on here. Please see https://github.com/microsoft/msquic/blob/main/docs/Diagnostics.md#trace-collection for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Proposed by non-MSFT question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants