Lines Matching +full:poll +full:- +full:timeout +full:- +full:ms

2  *  Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
11 * @file quic-hq-interop.c
15 * interoperability with hq-interop servers. It handles connection setup,
20 * and uses non-blocking mode for QUIC operations.
30 * quic-hq-interop <host> <port> <reqfile>
31 * host - The hostname of the server to contact
32 * port - The port that the server is listening on
33 * reqfile - a text file containing a space separated list of paths to fetch
37 * SSLKEYLOGFILE - set to a file path to record keylog exchange with server
38 * SSL_SESSION_FILE - set to a file path to record ssl sessions and restore
40 * SSL_CERT_FILE - The ca file to use when validating a server
41 * SSL_CIPHER_SUITES - The list of cipher suites to use (see openssl-ciphers)
93 * @note The function uses OpenSSL's socket-related functions (e.g., BIO_socket,
103 int sock = -1; in create_socket_bio()
121 * Create a UDP socket. We could equally use non-OpenSSL calls such in create_socket_bio()
128 if (sock == -1) in create_socket_bio()
134 sock = -1; in create_socket_bio()
145 sock = -1; in create_socket_bio()
152 if (sock != -1) { in create_socket_bio()
163 /* If sock is -1 then we've been unable to connect to the server */ in create_socket_bio()
164 if (sock == -1) in create_socket_bio()
201 * until the timeout specified by OpenSSL is reached. In a real application,
207 * mechanisms like poll or epoll for handling multiple file descriptors.
242 * poll/epoll or similar functions in wait_for_activity()
250 * a GUI every 100ms. One way to do that would be to use the timeout in in wait_for_activity()
252 * than 100ms then use 100ms instead. Then, when select returns, you in wait_for_activity()
254 * because of the timeout. If the 100ms GUI timeout has expired but the in wait_for_activity()
255 * tvp timeout has not then go and update the GUI and then restart the in wait_for_activity()
273 * - 1: Temporary failure, the operation should be retried.
274 * - 0: EOF, indicating the connection has been closed.
275 * - -1: A fatal error occurred or the connection has been reset.
297 return -1; in handle_io_failure()
302 * stream reset - or some failure occurred on the underlying in handle_io_failure()
330 return -1; in handle_io_failure()
333 return -1; in handle_io_failure()
478 * @brief Counter for the number of poll items.
512 * @brief Builds and processes a set of SSL poll requests.
514 * This function creates a new set of SSL poll requests based on the current
515 * request array. It allocates and manages memory for poll lists, BIO output
522 * @return The number of poll requests successfully built, or 0 on error.
536 * Free any previous poll list in build_request_set()
558 * note req_idx may start at a non-zero value if in build_request_set()
563 /* Up our poll count and set our poll_list index */ in build_request_set()
565 poll_idx = poll_count - 1; in build_request_set()
640 poll_count--; in build_request_set()
645 * Create a poll descriptor for this stream in build_request_set()
691 * performs host verification, configures ALPN, and establishes a non-blocking
704 unsigned char alpn[] = {10, 'h', 'q', '-', 'i', 'n', 't', 'e', 'r', 'o', 'p'}; in setup_connection()
835 * @brief Entry point for the QUIC hq-interop client demo application.
838 * requests for files specified in the command-line arguments, and saves
842 * @param argc The number of command-line arguments.
843 * @param argv The array of command-line arguments. The expected format is
848 * - Parses command-line arguments.
849 * - Reads the list of requests from the specified file.
850 * - Sets up the SSL context and configures certificate verification.
851 * - Optionally enables key logging and session caching.
852 * - Establishes a non-blocking QUIC connection to the server.
853 * - Sends an HTTP GET request for each file and writes the response
855 * - Gracefully shuts down the SSL connection and frees resources.
856 * - Prints any OpenSSL error stack information on failure.
882 fprintf(stderr, "Usage: quic-hq-interop hostname port reqfile\n"); in main()
923 req_array[total_requests - 1] = req; in main()
927 /* get a list of requests to poll */ in main()
931 * Now poll all our descriptors for events in main()
939 fprintf(stderr, "Failed to poll\n"); in main()
943 /* Iterate over our poll array looking for ready SSL's */ in main()
947 * indicated were ready, we can go poll again in main()
956 result_count--; in main()
958 /* And clear the revents for the next poll */ in main()
974 break; /* Retry on next poll */ in main()
978 case -1: in main()
1002 * If we've completed this poll set, try get another one in main()