diff options
author | Nils Durner <durner@gnunet.org> | 2009-08-09 08:25:58 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2009-08-09 08:25:58 +0000 |
commit | b309c5f5ae339faf3632f7ee3a86520981f6523a (patch) | |
tree | 76a946e557092b5a7dd88119e2193a1849890bc0 /src/util/test_network.c | |
parent | 3ec9635b91ede9037261608d3d173e348c7d9bd8 (diff) | |
download | gnunet-b309c5f5ae339faf3632f7ee3a86520981f6523a.tar.gz gnunet-b309c5f5ae339faf3632f7ee3a86520981f6523a.zip |
rename NETWORK_socket API to NETWORK_connection (to make room for the new actual NET API)
Diffstat (limited to 'src/util/test_network.c')
-rw-r--r-- | src/util/test_network.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/util/test_network.c b/src/util/test_network.c index 02555c299..cb0656921 100644 --- a/src/util/test_network.c +++ b/src/util/test_network.c | |||
@@ -32,11 +32,11 @@ | |||
32 | #define PORT 12435 | 32 | #define PORT 12435 |
33 | 33 | ||
34 | 34 | ||
35 | static struct GNUNET_NETWORK_SocketHandle *csock; | 35 | static struct GNUNET_NETWORK_ConnectionHandle *csock; |
36 | 36 | ||
37 | static struct GNUNET_NETWORK_SocketHandle *asock; | 37 | static struct GNUNET_NETWORK_ConnectionHandle *asock; |
38 | 38 | ||
39 | static struct GNUNET_NETWORK_SocketHandle *lsock; | 39 | static struct GNUNET_NETWORK_ConnectionHandle *lsock; |
40 | 40 | ||
41 | static size_t sofar; | 41 | static size_t sofar; |
42 | 42 | ||
@@ -88,7 +88,7 @@ receive_check (void *cls, | |||
88 | #if VERBOSE | 88 | #if VERBOSE |
89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n"); | 89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n"); |
90 | #endif | 90 | #endif |
91 | GNUNET_NETWORK_receive (asock, | 91 | GNUNET_NETWORK_connection_receive (asock, |
92 | 1024, | 92 | 1024, |
93 | GNUNET_TIME_relative_multiply | 93 | GNUNET_TIME_relative_multiply |
94 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, | 94 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, |
@@ -101,7 +101,7 @@ receive_check (void *cls, | |||
101 | "Receive closes accepted socket\n"); | 101 | "Receive closes accepted socket\n"); |
102 | #endif | 102 | #endif |
103 | *ok = 0; | 103 | *ok = 0; |
104 | GNUNET_NETWORK_socket_destroy (asock); | 104 | GNUNET_NETWORK_connection_destroy (asock); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
@@ -112,19 +112,19 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
112 | #if VERBOSE | 112 | #if VERBOSE |
113 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n"); | 113 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n"); |
114 | #endif | 114 | #endif |
115 | asock = GNUNET_NETWORK_socket_create_from_accept (tc->sched, | 115 | asock = GNUNET_NETWORK_connection_create_from_accept (tc->sched, |
116 | NULL, NULL, ls, 1024); | 116 | NULL, NULL, ls, 1024); |
117 | GNUNET_assert (asock != NULL); | 117 | GNUNET_assert (asock != NULL); |
118 | GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_socket_check (asock)); | 118 | GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_connection_check (asock)); |
119 | #if VERBOSE | 119 | #if VERBOSE |
120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys listen socket\n"); | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys listen socket\n"); |
121 | #endif | 121 | #endif |
122 | GNUNET_NETWORK_socket_destroy (lsock); | 122 | GNUNET_NETWORK_connection_destroy (lsock); |
123 | #if VERBOSE | 123 | #if VERBOSE |
124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
125 | "Test asks to receive on accepted socket\n"); | 125 | "Test asks to receive on accepted socket\n"); |
126 | #endif | 126 | #endif |
127 | GNUNET_NETWORK_receive (asock, | 127 | GNUNET_NETWORK_connection_receive (asock, |
128 | 1024, | 128 | 1024, |
129 | GNUNET_TIME_relative_multiply | 129 | GNUNET_TIME_relative_multiply |
130 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); | 130 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); |
@@ -146,23 +146,23 @@ static void | |||
146 | task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 146 | task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
147 | { | 147 | { |
148 | ls = open_listen_socket (); | 148 | ls = open_listen_socket (); |
149 | lsock = GNUNET_NETWORK_socket_create_from_existing (tc->sched, ls, 0); | 149 | lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0); |
150 | GNUNET_assert (lsock != NULL); | 150 | GNUNET_assert (lsock != NULL); |
151 | csock = GNUNET_NETWORK_socket_create_from_connect (tc->sched, | 151 | csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched, |
152 | "localhost", PORT, 1024); | 152 | "localhost", PORT, 1024); |
153 | GNUNET_assert (csock != NULL); | 153 | GNUNET_assert (csock != NULL); |
154 | #if VERBOSE | 154 | #if VERBOSE |
155 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n"); | 155 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n"); |
156 | #endif | 156 | #endif |
157 | GNUNET_assert (NULL != | 157 | GNUNET_assert (NULL != |
158 | GNUNET_NETWORK_notify_transmit_ready (csock, | 158 | GNUNET_NETWORK_connection_notify_transmit_ready (csock, |
159 | 12, | 159 | 12, |
160 | GNUNET_TIME_UNIT_SECONDS, | 160 | GNUNET_TIME_UNIT_SECONDS, |
161 | &make_hello, NULL)); | 161 | &make_hello, NULL)); |
162 | #if VERBOSE | 162 | #if VERBOSE |
163 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys client socket\n"); | 163 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys client socket\n"); |
164 | #endif | 164 | #endif |
165 | GNUNET_NETWORK_socket_destroy (csock); | 165 | GNUNET_NETWORK_connection_destroy (csock); |
166 | #if VERBOSE | 166 | #if VERBOSE |
167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n"); | 167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n"); |
168 | #endif | 168 | #endif |