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

1 #include <sys/poll.h>
17 * simply calls back into this code when poll()/etc. indicates it is ready.
130 conn->ssl_bio = out; in new_conn()
135 * Non-blocking transmission.
137 * Returns -1 on error. Returns -2 if the function would block (corresponds to
144 conn->tx_need_rx = 0; in tx()
146 l = BIO_write(conn->ssl_bio, buf, buf_len); in tx()
148 if (BIO_should_retry(conn->ssl_bio)) { in tx()
149 conn->tx_need_rx = BIO_should_read(conn->ssl_bio); in tx()
150 return -2; in tx()
152 return -1; in tx()
160 * Non-blocking reception.
162 * Returns -1 on error. Returns -2 if the function would block (corresponds to
169 conn->rx_need_tx = 0; in rx()
171 l = BIO_read(conn->ssl_bio, buf, buf_len); in rx()
173 if (BIO_should_retry(conn->ssl_bio)) { in rx()
174 conn->rx_need_tx = BIO_should_write(conn->ssl_bio); in rx()
175 return -2; in rx()
177 return -1; in rx()
185 * The application wants to know a fd it can poll on to determine when the
193 if (!BIO_get_rpoll_descriptor(conn->ssl_bio, &d)) in get_conn_fd()
194 return -1; in get_conn_fd()
198 return BIO_get_fd(conn->ssl_bio, NULL); in get_conn_fd()
218 return (SSL_net_read_desired(conn->ssl) ? POLLIN : 0) in get_conn_pending_tx()
219 | (SSL_net_write_desired(conn->ssl) ? POLLOUT : 0) in get_conn_pending_tx()
222 return (conn->tx_need_rx ? POLLIN : 0) | POLLOUT | POLLERR; in get_conn_pending_tx()
231 return (conn->rx_need_tx ? POLLOUT : 0) | POLLIN | POLLERR; in get_conn_pending_rx()
241 BIO_free_all(conn->ssl_bio); in teardown()
265 int timeout = 2000 /* ms */; in main() local
295 tx_len -= l; in main()
296 } else if (l == -1) { in main()
298 } else if (l == -2) { in main()
302 if (poll(&pfd, 1, timeout) == 0) { in main()
303 fprintf(stderr, "tx timeout\n"); in main()
314 } else if (l == -1) { in main()
316 } else if (l == -2) { in main()
320 if (poll(&pfd, 1, timeout) == 0) { in main()
321 fprintf(stderr, "rx timeout\n"); in main()