From 62c5917200044196d8d453e8213d18ee632d8dc5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 12 Oct 2009 21:16:56 +0000 Subject: * include/apr_network_io.h, * network_io/unix/socket_util.c (apr_socket_atreadeof): Renamed from apr_socket_is_connected; adjusted to return an apr_status_t error code, and pass an "at EOF" flag via an output parameter. * test/testsock.c (test_atreadeof): Renamed from test_is_connected, adjusted for new API. Submitted by: jorton, rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824500 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'include/apr_network_io.h') diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 19955301f..690be8553 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -375,17 +375,19 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** - * Check whether the send part of the socket is still open on the - * peer or that there is still data in the socket's read buffer. - * If this is false the next read on the socket will return APR_EOF. + * Determine whether the receive part of the socket has been closed by + * the peer (such that a subsequent call to apr_socket_read would + * return APR_EOF), if the socket's receive buffer is empty. This + * function does not block waiting for I/O. + * * @param socket The socket to check - * @remark - *
- * This function does not block on the socket but returns immediately in
- * any case.
- * 
+ * @param atreadeof If APR_SUCCESS is returned, *atreadeof is set to + * non-zero if a subsequent read would return APR_EOF + * @return an error is returned if it was not possible to determine the + * status, in which case *atreadeof is not changed. */ -APR_DECLARE(int) apr_socket_is_connected(apr_socket_t *socket); +APR_DECLARE(apr_status_t) apr_socket_atreadeof(apr_socket_t *sock, + int *atreadeof); /** * Create apr_sockaddr_t from hostname, address family, and port. -- cgit v1.2.1