Lines Matching +full:if +full:- +full:mode +full:- +full:en
1 .\" -*- mode: troff; coding: utf-8 -*-
33 .\" If the F register is >0, we'll generate index entries on stderr for
44 . if \nF \{\
48 . if !\nF==2 \{\
57 .IX Title "OSSL-GUIDE-QUIC-MULTI-STREAM 7ossl"
58 .TH OSSL-GUIDE-QUIC-MULTI-STREAM 7ossl 2025-09-30 3.5.4 OpenSSL
64 ossl\-guide\-quic\-multi\-stream
65 \&\- OpenSSL Guide: Writing a simple multi\-stream QUIC client
69 QUIC multi-stream application. It assumes a basic understanding of QUIC and how
70 it is used in OpenSSL. See \fBossl\-guide\-quic\-introduction\fR\|(7) and
71 \&\fBossl\-guide\-quic\-client\-block\fR\|(7).
74 In a QUIC multi-stream application we separate out the concepts of a QUIC
88 streams, e.g. if an application sends data on stream 1 first and then sends some
98 (see \fBossl\-guide\-libraries\-introduction\fR\|(7)). In particular most OpenSSL
113 (by default) the default stream will be a client-initiated bi-directional
114 stream. If a client application calls \fBSSL_read_ex\fR\|(3) or \fBSSL_read\fR\|(3)
116 stream (whether it is bi-directional or uni-directional).
118 This behaviour can be controlled via the default stream mode. See
121 It is recommended that new multi-stream applications should not use a default
124 and setting the mode to \fBSSL_DEFAULT_STREAM_MODE_NONE\fR.
130 bi-directional or a uni-directional stream.
139 a remotely initiated stream. If the peer has not initiated any then this call
140 will block until one is available if the connection object is in blocking mode
147 is not relevant if the default stream has been disabled as described in
150 Any stream may be bi-directional or uni-directional. If it is uni-directional
151 then the initiator can write to it but not read from it, and vice-versa for the
157 object if a default stream is in use) then you can send and receive data over it
163 In blocking mode this will either be a fatal error (e.g. \fBSSL_ERROR_SYSCALL\fR
172 connection. If the peer has concluded the stream then no more data will be
188 the connection via a call to \fBSSL_get0_connection\fR\|(3). Multi-threaded
190 object. Specifically, if you are handling each of your stream objects in a
195 \&\fBSSL_get_accept_stream_queue_len\fR\|(3) which are thread-safe).
203 .SH "SIMPLE MULTI-STREAM QUIC CLIENT EXAMPLE"
204 .IX Header "SIMPLE MULTI-STREAM QUIC CLIENT EXAMPLE"
206 a simple multi-stream QUIC client application which connects to a server, send
208 over QUIC is non-standard and will not be supported by real world servers. This
212 covered on the \fBossl\-guide\-quic\-client\-block\fR\|(7) page and we assume that you
214 blocking QUIC client and the multi-stream QUIC client. Although the example code
216 See \fBossl\-guide\-quic\-client\-non\-block\fR\|(7) for more information about writing a
219 The complete source code for this example multi-stream QUIC client is available
221 \&\f(CW\*(C`quic\-multi\-stream.c\*(C'\fR. It is also available online at
222 <https://github.com/openssl/openssl/blob/master/demos/guide/quic\-multi\-stream.c>.
226 to disable the default stream for our multi-stream client. To do this we call
232 \& * We will use multiple streams so we will disable the default stream mode.
235 \& if (!SSL_set_default_stream_mode(ssl, SSL_DEFAULT_STREAM_MODE_NONE)) {
236 \& printf("Failed to disable the default stream mode\en");
244 first of these will be a bi-directional stream and the second one will be a
245 uni-directional one:
250 \& * bi\-directional, and the second will be uni\-directional.
254 \& if (stream1 == NULL || stream2 == NULL) {
255 \& printf("Failed to create streams\en");
270 \& const char *request_end = "\er\en\er\en";
273 \& if (!SSL_write_ex(stream, request_start, strlen(request_start), &written))
275 \& if (!SSL_write_ex(stream, hostname, strlen(hostname), &written))
277 \& if (!SSL_write_ex(stream, request_end, strlen(request_end), &written))
296 \& if (!write_a_request(stream1, request1_start, hostname)) {
297 \& printf("Failed to write HTTP request on stream 1\en");
301 \& if (!write_a_request(stream2, request2_start, hostname)) {
302 \& printf("Failed to write HTTP request on stream 2\en");
308 In this example \fBstream1\fR is a bi-directional stream so, once we have sent the
315 \& printf("Stream 1 data:\en");
325 \& * number of bytes that we read. The data could be non\-printable or
332 \& printf("\en");
368 \& * reset \- or some failure occurred on the underlying connection.
372 \& printf("Stream reset occurred\en");
377 \& printf("Connection closed\en");
382 \& printf("Unknown stream failure\en");
389 \& printf ("Failed reading remaining data\en");
395 Our \fBstream2\fR object that we created above was a uni-directional stream so it
407 \& * containing the data requested in our uni\-directional stream. This doesn\*(Aqt
411 \& * We\*(Aqre using blocking mode so this will block until a stream becomes
412 \& * available. We could override this behaviour if we wanted to by setting
416 \& if (stream3 == NULL) {
417 \& printf("Failed to accept a new stream\en");
427 \&\fBSSL_free\fR\|(3). Optionally we could call \fBSSL_stream_conclude\fR\|(3) on them if
443 \&\fBossl\-guide\-introduction\fR\|(7), \fBossl\-guide\-libraries\-introduction\fR\|(7),
444 \&\fBossl\-guide\-libssl\-introduction\fR\|(7) \fBossl\-guide\-quic\-introduction\fR\|(7),
445 \&\fBossl\-guide\-quic\-client\-block\fR\|(7)