summaryrefslogtreecommitdiff
path: root/test/testsockets.c
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2003-11-30 16:47:29 +0000
committerJeff Trawick <trawick@apache.org>2003-11-30 16:47:29 +0000
commit0f5aaf28e96c74252e60f80b712afd7b79c5309d (patch)
tree047b6dd550e37aecbc1df713d6d54519bf4203b5 /test/testsockets.c
parent0111c4c0738a80fe1af1ca3628151674ad0f71b5 (diff)
downloadapr-0f5aaf28e96c74252e60f80b712afd7b79c5309d.tar.gz
Add apr_socket_type_get() for retrieving the type (e.g., stream)
of the socket. Submitted by: Philippe M. Chiasson <gozer cpan.org> Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64801 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testsockets.c')
-rw-r--r--test/testsockets.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/testsockets.c b/test/testsockets.c
index 87f46a027..1ba2ea111 100644
--- a/test/testsockets.c
+++ b/test/testsockets.c
@@ -72,10 +72,16 @@ static void tcp_socket(CuTest *tc)
{
apr_status_t rv;
apr_socket_t *sock = NULL;
+ int type;
rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
CuAssertPtrNotNull(tc, sock);
+
+ rv = apr_socket_type_get(sock, &type);
+ CuAssertIntEquals(tc, APR_SUCCESS, rv);
+ CuAssertIntEquals(tc, SOCK_STREAM, type);
+
apr_socket_close(sock);
}
@@ -83,10 +89,16 @@ static void udp_socket(CuTest *tc)
{
apr_status_t rv;
apr_socket_t *sock = NULL;
+ int type;
rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
CuAssertPtrNotNull(tc, sock);
+
+ rv = apr_socket_type_get(sock, &type);
+ CuAssertIntEquals(tc, APR_SUCCESS, rv);
+ CuAssertIntEquals(tc, SOCK_DGRAM, type);
+
apr_socket_close(sock);
}