diff options
author | Joe Orton <jorton@apache.org> | 2009-10-12 21:16:56 +0000 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2009-10-12 21:16:56 +0000 |
commit | 62c5917200044196d8d453e8213d18ee632d8dc5 (patch) | |
tree | 8e705df5276318c1ecc6d497692cea79a7260ea3 /include/apr_network_io.h | |
parent | 42e5ac718f348f445e4a72db5fdd5dc24a1ffe00 (diff) | |
download | apr-62c5917200044196d8d453e8213d18ee632d8dc5.tar.gz |
* 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
Diffstat (limited to 'include/apr_network_io.h')
-rw-r--r-- | include/apr_network_io.h | 20 |
1 files changed, 11 insertions, 9 deletions
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 - * <PRE> - * This function does not block on the socket but returns immediately in - * any case. - * </PRE> + * @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. |