Lines Matching +full:wait +full:- +full:retry +full:- +full:us
1 .\" -*- mode: troff; coding: utf-8 -*-
57 .IX Title "OSSL-GUIDE-QUIC-CLIENT-NON-BLOCK 7ossl"
58 .TH OSSL-GUIDE-QUIC-CLIENT-NON-BLOCK 7ossl 2025-09-30 3.5.4 OpenSSL
64 ossl\-guide\-quic\-client\-non\-block
65 \&\- OpenSSL Guide: Writing a simple nonblocking QUIC client
69 \&\fBossl\-guide\-quic\-client\-block\fR\|(7) page which demonstrates how to write a simple
75 \&\fBquic\-client\-non\-block.c\fR. It is also available online at
76 <https://github.com/openssl/openssl/blob/master/demos/guide/quic\-client\-non\-block.c>.
93 \&\fBSSL_read_ex\fR\|(3) or \fBSSL_write_ex\fR\|(3) will return immediately with a non-fatal
97 \&\fBossl\-guide\-quic\-client\-block\fR\|(7) page we assume that you are familiar with it
105 the application has to do, it must also be prepared to come back and retry the
108 such that it might succeed on the retry attempt, but this does not have to be
109 the case. It can retry at any time.
111 Note that it is important that you retry exactly the same operation that you
115 write some other text when you retry the operation.
118 other work. In fact, for the sake of simplicity, it will do nothing except wait
155 \& * Wait until the socket is writeable or readable. We use select here
179 TLS (see \fBossl\-guide\-tls\-client\-non\-block\fR\|(7)) then you should note that there
182 to the \fBSSL\fR object and we get a "retry" response (\fBSSL_ERROR_WANT_READ\fR or
184 read or write to the underlying socket and the socket signalled the "retry".
185 With QUIC that is not the case. OpenSSL may signal retry as a result of an
188 socket needs to retry or not.
222 has failed), or non-fatal (for example because we are trying to read from the
230 out what type of error has occurred. If the error is non-fatal and can be
237 Another type of non-fatal error that may occur is \fBSSL_ERROR_ZERO_RETURN\fR. This
238 indicates an EOF (End-Of-File) which can occur if you attempt to read data from
264 \& /* Temporary failure. Wait until we can read/write and try again */
273 \& return \-1;
278 \& * stream reset \- or some failure occurred on the underlying
306 \& return \-1;
309 \& return \-1;
316 the event of a non-fatal failure, it waits until a retry of the I/O operation
318 in the previous section). It returns 1 in the event of a non-fatal error
319 (except EOF), 0 in the event of EOF, or \-1 if a fatal error occurred.
324 explained on the \fBossl\-guide\-quic\-client\-block\fR\|(7) page. We won't repeat that
369 non-fatal error while we are waiting for the server to respond to our handshake
370 messages. In such a case we must retry the same \fBSSL_connect\fR\|(3) call at a
377 \& continue; /* Retry */
379 \& goto end; /* Cannot retry: error */
383 We continually call \fBSSL_connect\fR\|(3) until it gives us a success response.
391 a nonblocking \fBSSL\fR object, this call could fail with a non-fatal error. In
392 that case we should retry exactly the same \fBSSL_write_ex\fR\|(3) call again. Note
395 data on a retry. An optional mode does exist
397 the buffer being written to change from one retry to the next. However, in this
398 case, you must still retry exactly the same data \- even though the buffer that
400 details. As in the TLS tutorials (\fBossl\-guide\-tls\-client\-block\fR\|(7)) we write
413 \& continue; /* Retry */
415 \& goto end; /* Cannot retry: error */
419 \& continue; /* Retry */
421 \& goto end; /* Cannot retry: error */
426 \& continue; /* Retry */
428 \& goto end; /* Cannot retry: error */
446 \& continue; /* Retry */
450 \& case \-1:
453 \& goto end; /* Cannot retry: error */
459 \& * number of bytes that we read. The data could be non\-printable or
470 The main difference this time is that it is valid for us to receive an EOF
483 this tell us nothing about the state of the underlying connection. Our demo
491 have to retry this operation several times. If \fBSSL_shutdown\fR\|(3) returns a
503 \& continue; /* Retry */
513 See \fBossl\-guide\-quic\-client\-block\fR\|(7) to read a tutorial on how to write a
514 blocking QUIC client. See \fBossl\-guide\-quic\-multi\-stream\fR\|(7) to see how to write
515 a multi-stream QUIC client.
518 \&\fBossl\-guide\-introduction\fR\|(7), \fBossl\-guide\-libraries\-introduction\fR\|(7),
519 \&\fBossl\-guide\-libssl\-introduction\fR\|(7), \fBossl\-guide\-quic\-introduction\fR\|(7),
520 \&\fBossl\-guide\-quic\-client\-block\fR\|(7), \fBossl\-guide\-quic\-multi\-stream\fR\|(7)
523 Copyright 2023\-2025 The OpenSSL Project Authors. All Rights Reserved.