Skip to content

Commit

Permalink
Update quic example
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Dec 27, 2024
1 parent 0ba506f commit 182b7e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/http3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void on_stream_headers(us_quic_stream_t *s) {
//print_current_headers();

/* Make a new stream */
us_quic_socket_create_stream(us_quic_stream_socket(s));
us_quic_socket_create_stream(us_quic_stream_socket(s), 0);
}

/* And this would be the body of the request */
Expand All @@ -109,7 +109,7 @@ void on_start(struct us_timer_t *t) {


if (num_sockets < 10) {
us_quic_socket_t *connect_socket = us_quic_socket_context_connect(context, "::1", 9004);
us_quic_socket_t *connect_socket = us_quic_socket_context_connect(context, "::1", 9004, 0);
} else {
if (!ignore) {

Expand All @@ -120,7 +120,7 @@ void on_start(struct us_timer_t *t) {
printf("Starting now\n");
for (int i = 0; i < num_sockets; i++) {
for (int j = 0; j < 32; j++) {
us_quic_socket_create_stream(sockets[i]);
us_quic_socket_create_stream(sockets[i], 0);
}
}
}
Expand Down Expand Up @@ -171,7 +171,7 @@ int main() {
};

/* Create quic socket context (assumes h3 for now) */
context = us_create_quic_socket_context(loop, options);
context = us_create_quic_socket_context(loop, options, 0);

/* Specify application callbacks */
us_quic_socket_context_on_stream_data(context, on_stream_data);
Expand Down
4 changes: 2 additions & 2 deletions examples/http3_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main() {
};

/* Create quic socket context (assumes h3 for now) */
context = us_create_quic_socket_context(loop, options);
context = us_create_quic_socket_context(loop, options, 0);

/* Specify application callbacks */
us_quic_socket_context_on_stream_data(context, on_stream_data);
Expand All @@ -101,7 +101,7 @@ int main() {
us_quic_socket_context_on_close(context, on_close);

/* The listening socket is the actual UDP socket used */
us_quic_listen_socket_t *listen_socket = us_quic_socket_context_listen(context, "::1", 9004);
us_quic_listen_socket_t *listen_socket = us_quic_socket_context_listen(context, "::1", 9004, 0);

/* Run the event loop */
us_loop_run(loop);
Expand Down

0 comments on commit 182b7e4

Please sign in to comment.