Skip to content

Cannot send datagrams from server to client #1827

Answered by huitema
a-andre asked this question in Q&A
Discussion options

You must be logged in to vote

I am looking at your code, and I can see two issues:

    case picoquic_callback_prepare_datagram:
    {
        std::cout << "picoquic_callback_prepare_datagram" << std::endl;
        auto buffer = picoquic_provide_datagram_buffer_ex(bytes, length, picoquic_datagram_not_active);
        if (buffer == nullptr) {
            std::cerr << "error" << std::endl;
            return -1;
        }
        std::string msg = "Hello ";
        if (g_is_server)
            msg.append("from Server");
        else
            msg.append("from Client");
        memcpy(buffer, msg.c_str(), msg.length());
        break;
    }
  1. In the call to picoquic_provide_datagram_buffer_ex, you set the continuation s…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@a-andre
Comment options

@huitema
Comment options

@a-andre
Comment options

@huitema
Comment options

Answer selected by a-andre
@a-andre
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
2 participants