aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core_api.c2
-rw-r--r--src/core/gnunet-service-core.c2
-rw-r--r--src/include/gnunet_client_lib.h2
-rw-r--r--src/include/gnunet_network_lib.h34
-rw-r--r--src/include/gnunet_server_lib.h4
-rw-r--r--src/transport/plugin_transport_tcp.c12
-rw-r--r--src/transport/transport_api.c4
-rw-r--r--src/util/client.c16
-rw-r--r--src/util/network.c76
-rw-r--r--src/util/server.c26
-rw-r--r--src/util/test_network.c26
-rw-r--r--src/util/test_network_addressing.c28
-rw-r--r--src/util/test_network_receive_cancel.c24
-rw-r--r--src/util/test_network_timeout.c16
-rw-r--r--src/util/test_network_timeout_no_connect.c6
-rw-r--r--src/util/test_network_transmit_cancel.c10
16 files changed, 144 insertions, 144 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index f3e30eb9a..6a1b88147 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -836,7 +836,7 @@ void
836GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) 836GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
837{ 837{
838 if (handle->th != NULL) 838 if (handle->th != NULL)
839 GNUNET_NETWORK_notify_transmit_ready_cancel (handle->th); 839 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (handle->th);
840 if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 840 if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
841 GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); 841 GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task);
842 GNUNET_CLIENT_disconnect (handle->client); 842 GNUNET_CLIENT_disconnect (handle->client);
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 6f6129f77..a6a64a9fd 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -1021,7 +1021,7 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
1021 else 1021 else
1022 prev->next = pos->next; 1022 prev->next = pos->next;
1023 if (pos->th != NULL) 1023 if (pos->th != NULL)
1024 GNUNET_NETWORK_notify_transmit_ready_cancel (pos->th); 1024 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (pos->th);
1025 while (NULL != (e = pos->event_head)) 1025 while (NULL != (e = pos->event_head))
1026 { 1026 {
1027 pos->event_head = e->next; 1027 pos->event_head = e->next;
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h
index eb8e1d127..b73691b79 100644
--- a/src/include/gnunet_client_lib.h
+++ b/src/include/gnunet_client_lib.h
@@ -109,7 +109,7 @@ void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
109 * @param notify_cls closure for notify 109 * @param notify_cls closure for notify
110 * @return NULL if someone else is already waiting to be notified 110 * @return NULL if someone else is already waiting to be notified
111 * non-NULL if the notify callback was queued (can be used to cancel 111 * non-NULL if the notify callback was queued (can be used to cancel
112 * using GNUNET_NETWORK_notify_transmit_ready_cancel) 112 * using GNUNET_NETWORK_connection_notify_transmit_ready_cancel)
113 */ 113 */
114struct GNUNET_NETWORK_TransmitHandle 114struct GNUNET_NETWORK_TransmitHandle
115 *GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, 115 *GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock,
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 26a39d575..68ca346e5 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -44,9 +44,9 @@ extern "C"
44#define GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 44#define GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
45 45
46/** 46/**
47 * @brief handle for a network socket 47 * @brief handle for a network connection
48 */ 48 */
49struct GNUNET_NETWORK_SocketHandle; 49struct GNUNET_NETWORK_ConnectionHandle;
50 50
51 51
52/** 52/**
@@ -93,8 +93,8 @@ typedef void (*GNUNET_NETWORK_Receiver) (void *cls,
93 * 0 for sockets that need no write buffers, such as listen sockets) 93 * 0 for sockets that need no write buffers, such as listen sockets)
94 * @return the boxed socket handle 94 * @return the boxed socket handle
95 */ 95 */
96struct GNUNET_NETWORK_SocketHandle 96struct GNUNET_NETWORK_ConnectionHandle
97 *GNUNET_NETWORK_socket_create_from_existing (struct GNUNET_SCHEDULER_Handle 97 *GNUNET_NETWORK_connection_create_from_existing (struct GNUNET_SCHEDULER_Handle
98 *sched, int osSocket, 98 *sched, int osSocket,
99 size_t maxbuf); 99 size_t maxbuf);
100 100
@@ -111,8 +111,8 @@ struct GNUNET_NETWORK_SocketHandle
111 * 0 for sockets that need no write buffers, such as listen sockets) 111 * 0 for sockets that need no write buffers, such as listen sockets)
112 * @return the socket handle, NULL on error (for example, access refused) 112 * @return the socket handle, NULL on error (for example, access refused)
113 */ 113 */
114struct GNUNET_NETWORK_SocketHandle 114struct GNUNET_NETWORK_ConnectionHandle
115 *GNUNET_NETWORK_socket_create_from_accept (struct GNUNET_SCHEDULER_Handle 115 *GNUNET_NETWORK_connection_create_from_accept (struct GNUNET_SCHEDULER_Handle
116 *sched, 116 *sched,
117 GNUNET_NETWORK_AccessCheck 117 GNUNET_NETWORK_AccessCheck
118 access, void *access_cls, 118 access, void *access_cls,
@@ -131,8 +131,8 @@ struct GNUNET_NETWORK_SocketHandle
131 * 0 for sockets that need no write buffers, such as listen sockets) 131 * 0 for sockets that need no write buffers, such as listen sockets)
132 * @return the socket handle 132 * @return the socket handle
133 */ 133 */
134struct GNUNET_NETWORK_SocketHandle 134struct GNUNET_NETWORK_ConnectionHandle
135 *GNUNET_NETWORK_socket_create_from_connect (struct GNUNET_SCHEDULER_Handle 135 *GNUNET_NETWORK_connection_create_from_connect (struct GNUNET_SCHEDULER_Handle
136 *sched, const char *hostname, 136 *sched, const char *hostname,
137 uint16_t port, size_t maxbuf); 137 uint16_t port, size_t maxbuf);
138 138
@@ -151,8 +151,8 @@ struct GNUNET_NETWORK_SocketHandle
151 * 0 for sockets that need no write buffers, such as listen sockets) 151 * 0 for sockets that need no write buffers, such as listen sockets)
152 * @return the socket handle 152 * @return the socket handle
153 */ 153 */
154struct GNUNET_NETWORK_SocketHandle 154struct GNUNET_NETWORK_ConnectionHandle
155 *GNUNET_NETWORK_socket_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle 155 *GNUNET_NETWORK_connection_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle
156 *sched, int af_family, 156 *sched, int af_family,
157 const struct sockaddr 157 const struct sockaddr
158 *serv_addr, socklen_t addrlen, 158 *serv_addr, socklen_t addrlen,
@@ -166,7 +166,7 @@ struct GNUNET_NETWORK_SocketHandle
166 * @param sock socket to check 166 * @param sock socket to check
167 * @return GNUNET_YES if valid, GNUNET_NO otherwise 167 * @return GNUNET_YES if valid, GNUNET_NO otherwise
168 */ 168 */
169int GNUNET_NETWORK_socket_check (struct GNUNET_NETWORK_SocketHandle *sock); 169int GNUNET_NETWORK_connection_check (struct GNUNET_NETWORK_ConnectionHandle *sock);
170 170
171 171
172/** 172/**
@@ -177,7 +177,7 @@ int GNUNET_NETWORK_socket_check (struct GNUNET_NETWORK_SocketHandle *sock);
177 * @param addrlen where to store the length of the address 177 * @param addrlen where to store the length of the address
178 * @return GNUNET_OK on success 178 * @return GNUNET_OK on success
179 */ 179 */
180int GNUNET_NETWORK_socket_get_address (struct GNUNET_NETWORK_SocketHandle 180int GNUNET_NETWORK_connection_get_address (struct GNUNET_NETWORK_ConnectionHandle
181 *sock, void **addr, size_t * addrlen); 181 *sock, void **addr, size_t * addrlen);
182 182
183/** 183/**
@@ -187,7 +187,7 @@ int GNUNET_NETWORK_socket_get_address (struct GNUNET_NETWORK_SocketHandle
187 * 187 *
188 * @param sock socket to destroy 188 * @param sock socket to destroy
189 */ 189 */
190void GNUNET_NETWORK_socket_destroy (struct GNUNET_NETWORK_SocketHandle *sock); 190void GNUNET_NETWORK_connection_destroy (struct GNUNET_NETWORK_ConnectionHandle *sock);
191 191
192 192
193/** 193/**
@@ -205,7 +205,7 @@ void GNUNET_NETWORK_socket_destroy (struct GNUNET_NETWORK_SocketHandle *sock);
205 * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error 205 * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error
206 */ 206 */
207GNUNET_SCHEDULER_TaskIdentifier 207GNUNET_SCHEDULER_TaskIdentifier
208GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, 208GNUNET_NETWORK_connection_receive (struct GNUNET_NETWORK_ConnectionHandle *sock,
209 size_t max, 209 size_t max,
210 struct GNUNET_TIME_Relative timeout, 210 struct GNUNET_TIME_Relative timeout,
211 GNUNET_NETWORK_Receiver receiver, void *receiver_cls); 211 GNUNET_NETWORK_Receiver receiver, void *receiver_cls);
@@ -220,7 +220,7 @@ GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock,
220 * @param task task identifier returned from the receive call 220 * @param task task identifier returned from the receive call
221 * @return closure of the original receiver callback 221 * @return closure of the original receiver callback
222 */ 222 */
223void *GNUNET_NETWORK_receive_cancel (struct GNUNET_NETWORK_SocketHandle *sock, 223void *GNUNET_NETWORK_connection_receive_cancel (struct GNUNET_NETWORK_ConnectionHandle *sock,
224 GNUNET_SCHEDULER_TaskIdentifier task); 224 GNUNET_SCHEDULER_TaskIdentifier task);
225 225
226 226
@@ -275,7 +275,7 @@ struct GNUNET_NETWORK_TransmitHandle;
275 * NULL if we are already going to notify someone else (busy) 275 * NULL if we are already going to notify someone else (busy)
276 */ 276 */
277struct GNUNET_NETWORK_TransmitHandle 277struct GNUNET_NETWORK_TransmitHandle
278 *GNUNET_NETWORK_notify_transmit_ready (struct GNUNET_NETWORK_SocketHandle 278 *GNUNET_NETWORK_connection_notify_transmit_ready (struct GNUNET_NETWORK_ConnectionHandle
279 *sock, size_t size, 279 *sock, size_t size,
280 struct GNUNET_TIME_Relative timeout, 280 struct GNUNET_TIME_Relative timeout,
281 GNUNET_NETWORK_TransmitReadyNotify 281 GNUNET_NETWORK_TransmitReadyNotify
@@ -289,7 +289,7 @@ struct GNUNET_NETWORK_TransmitHandle
289 * @param h handle for notification to cancel 289 * @param h handle for notification to cancel
290 */ 290 */
291void 291void
292GNUNET_NETWORK_notify_transmit_ready_cancel (struct 292GNUNET_NETWORK_connection_notify_transmit_ready_cancel (struct
293 GNUNET_NETWORK_TransmitHandle 293 GNUNET_NETWORK_TransmitHandle
294 *h); 294 *h);
295 295
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index aa79d7833..82085ad0d 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -175,7 +175,7 @@ GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server,
175 * @param callback_cls closure for callback 175 * @param callback_cls closure for callback
176 * @return non-NULL if the notify callback was queued; can be used 176 * @return non-NULL if the notify callback was queued; can be used
177 * to cancel the request using 177 * to cancel the request using
178 * GNUNET_NETWORK_notify_transmit_ready_cancel. 178 * GNUNET_NETWORK_connection_notify_transmit_ready_cancel.
179 * NULL if we are already going to notify someone else (busy) 179 * NULL if we are already going to notify someone else (busy)
180 */ 180 */
181struct GNUNET_NETWORK_TransmitHandle 181struct GNUNET_NETWORK_TransmitHandle
@@ -238,7 +238,7 @@ struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct
238 GNUNET_SERVER_Handle 238 GNUNET_SERVER_Handle
239 *server, 239 *server,
240 struct 240 struct
241 GNUNET_NETWORK_SocketHandle 241 GNUNET_NETWORK_ConnectionHandle
242 *connection); 242 *connection);
243 243
244 244
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 7585e26e8..764ef8b2f 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -357,7 +357,7 @@ struct Plugin
357 /** 357 /**
358 * The listen socket. 358 * The listen socket.
359 */ 359 */
360 struct GNUNET_NETWORK_SocketHandle *lsock; 360 struct GNUNET_NETWORK_ConnectionHandle *lsock;
361 361
362 /** 362 /**
363 * List of open TCP sessions. 363 * List of open TCP sessions.
@@ -652,7 +652,7 @@ connect_and_create_validation_session (struct Plugin *plugin,
652 const void *addr, size_t addrlen) 652 const void *addr, size_t addrlen)
653{ 653{
654 struct GNUNET_SERVER_Client *client; 654 struct GNUNET_SERVER_Client *client;
655 struct GNUNET_NETWORK_SocketHandle *conn; 655 struct GNUNET_NETWORK_ConnectionHandle *conn;
656 struct Session *session; 656 struct Session *session;
657 int af; 657 int af;
658 658
@@ -665,7 +665,7 @@ connect_and_create_validation_session (struct Plugin *plugin,
665 GNUNET_break_op (0); 665 GNUNET_break_op (0);
666 return NULL; /* invalid address */ 666 return NULL; /* invalid address */
667 } 667 }
668 conn = GNUNET_NETWORK_socket_create_from_sockaddr (plugin->env->sched, 668 conn = GNUNET_NETWORK_connection_create_from_sockaddr (plugin->env->sched,
669 af, 669 af,
670 addr, 670 addr,
671 addrlen, 671 addrlen,
@@ -796,7 +796,7 @@ disconnect_session (struct Session *session)
796 /* clean up state */ 796 /* clean up state */
797 if (session->transmit_handle != NULL) 797 if (session->transmit_handle != NULL)
798 { 798 {
799 GNUNET_NETWORK_notify_transmit_ready_cancel (session->transmit_handle); 799 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (session->transmit_handle);
800 session->transmit_handle = NULL; 800 session->transmit_handle = NULL;
801 } 801 }
802 while (NULL != (pm = session->pending_messages)) 802 while (NULL != (pm = session->pending_messages))
@@ -877,7 +877,7 @@ struct ConnectContext
877{ 877{
878 struct Plugin *plugin; 878 struct Plugin *plugin;
879 879
880 struct GNUNET_NETWORK_SocketHandle *sa; 880 struct GNUNET_NETWORK_ConnectionHandle *sa;
881 881
882 struct PendingMessage *welcome; 882 struct PendingMessage *welcome;
883 883
@@ -923,7 +923,7 @@ try_connect_to_address (void *cls,
923 { 923 {
924 cc->welcome = create_welcome (addrlen, addr, cc->plugin); 924 cc->welcome = create_welcome (addrlen, addr, cc->plugin);
925 cc->sa = 925 cc->sa =
926 GNUNET_NETWORK_socket_create_from_sockaddr (cc->plugin->env->sched, 926 GNUNET_NETWORK_connection_create_from_sockaddr (cc->plugin->env->sched,
927 af, addr, addrlen, 927 af, addr, addrlen,
928 GNUNET_SERVER_MAX_MESSAGE_SIZE); 928 GNUNET_SERVER_MAX_MESSAGE_SIZE);
929#if DEBUG_TCP 929#if DEBUG_TCP
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 3a5c8e0f5..93efcb4ba 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -1573,7 +1573,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
1573#endif 1573#endif
1574 if (h->network_handle != NULL) 1574 if (h->network_handle != NULL)
1575 { 1575 {
1576 GNUNET_NETWORK_notify_transmit_ready_cancel (h->network_handle); 1576 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (h->network_handle);
1577 h->network_handle = NULL; 1577 h->network_handle = NULL;
1578 h->transmission_scheduled = GNUNET_NO; 1578 h->transmission_scheduled = GNUNET_NO;
1579 th = h->connect_ready_head; 1579 th = h->connect_ready_head;
@@ -1964,7 +1964,7 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct
1964 h = th->handle; 1964 h = th->handle;
1965 if ((h->connect_ready_head == NULL) && (h->network_handle != NULL)) 1965 if ((h->connect_ready_head == NULL) && (h->network_handle != NULL))
1966 { 1966 {
1967 GNUNET_NETWORK_notify_transmit_ready_cancel (h->network_handle); 1967 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (h->network_handle);
1968 h->network_handle = NULL; 1968 h->network_handle = NULL;
1969 h->transmission_scheduled = GNUNET_NO; 1969 h->transmission_scheduled = GNUNET_NO;
1970 } 1970 }
diff --git a/src/util/client.c b/src/util/client.c
index ab50d9d4d..4e6e09066 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -48,7 +48,7 @@ struct GNUNET_CLIENT_Connection
48 /** 48 /**
49 * the socket handle, NULL if not live 49 * the socket handle, NULL if not live
50 */ 50 */
51 struct GNUNET_NETWORK_SocketHandle *sock; 51 struct GNUNET_NETWORK_ConnectionHandle *sock;
52 52
53 /** 53 /**
54 * Our scheduler. 54 * Our scheduler.
@@ -127,7 +127,7 @@ GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched,
127 const struct GNUNET_CONFIGURATION_Handle *cfg) 127 const struct GNUNET_CONFIGURATION_Handle *cfg)
128{ 128{
129 struct GNUNET_CLIENT_Connection *ret; 129 struct GNUNET_CLIENT_Connection *ret;
130 struct GNUNET_NETWORK_SocketHandle *sock; 130 struct GNUNET_NETWORK_ConnectionHandle *sock;
131 char *hostname; 131 char *hostname;
132 unsigned long long port; 132 unsigned long long port;
133 133
@@ -147,7 +147,7 @@ GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched,
147 service_name); 147 service_name);
148 return NULL; 148 return NULL;
149 } 149 }
150 sock = GNUNET_NETWORK_socket_create_from_connect (sched, 150 sock = GNUNET_NETWORK_connection_create_from_connect (sched,
151 hostname, 151 hostname,
152 port, 152 port,
153 GNUNET_SERVER_MAX_MESSAGE_SIZE); 153 GNUNET_SERVER_MAX_MESSAGE_SIZE);
@@ -184,7 +184,7 @@ void
184GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock) 184GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock)
185{ 185{
186 GNUNET_assert (sock->sock != NULL); 186 GNUNET_assert (sock->sock != NULL);
187 GNUNET_NETWORK_socket_destroy (sock->sock); 187 GNUNET_NETWORK_connection_destroy (sock->sock);
188 sock->sock = NULL; 188 sock->sock = NULL;
189 sock->receiver_handler = NULL; 189 sock->receiver_handler = NULL;
190 GNUNET_SCHEDULER_add_after (sock->sched, 190 GNUNET_SCHEDULER_add_after (sock->sched,
@@ -331,7 +331,7 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
331 GNUNET_SCHEDULER_NO_TASK, 331 GNUNET_SCHEDULER_NO_TASK,
332 &receive_task, sock); 332 &receive_task, sock);
333 else 333 else
334 sock->receiver_task = GNUNET_NETWORK_receive (sock->sock, 334 sock->receiver_task = GNUNET_NETWORK_connection_receive (sock->sock,
335 GNUNET_SERVER_MAX_MESSAGE_SIZE, 335 GNUNET_SERVER_MAX_MESSAGE_SIZE,
336 timeout, 336 timeout,
337 &receive_helper, sock); 337 &receive_helper, sock);
@@ -362,7 +362,7 @@ write_shutdown (void *cls, size_t size, void *buf)
362void 362void
363GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock) 363GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock)
364{ 364{
365 GNUNET_NETWORK_notify_transmit_ready (sock->sock, 365 GNUNET_NETWORK_connection_notify_transmit_ready (sock->sock,
366 sizeof (struct GNUNET_MessageHeader), 366 sizeof (struct GNUNET_MessageHeader),
367 GNUNET_TIME_UNIT_FOREVER_REL, 367 GNUNET_TIME_UNIT_FOREVER_REL,
368 &write_shutdown, NULL); 368 &write_shutdown, NULL);
@@ -478,7 +478,7 @@ GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched,
478 conn->test_cb = task; 478 conn->test_cb = task;
479 conn->test_cb_cls = task_cls; 479 conn->test_cb_cls = task_cls;
480 if (NULL == 480 if (NULL ==
481 GNUNET_NETWORK_notify_transmit_ready (conn->sock, 481 GNUNET_NETWORK_connection_notify_transmit_ready (conn->sock,
482 sizeof (struct 482 sizeof (struct
483 GNUNET_MessageHeader), 483 GNUNET_MessageHeader),
484 timeout, &write_test, NULL)) 484 timeout, &write_test, NULL))
@@ -515,7 +515,7 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock,
515 GNUNET_NETWORK_TransmitReadyNotify 515 GNUNET_NETWORK_TransmitReadyNotify
516 notify, void *notify_cls) 516 notify, void *notify_cls)
517{ 517{
518 return GNUNET_NETWORK_notify_transmit_ready (sock->sock, 518 return GNUNET_NETWORK_connection_notify_transmit_ready (sock->sock,
519 size, 519 size,
520 timeout, notify, notify_cls); 520 timeout, notify, notify_cls);
521} 521}
diff --git a/src/util/network.c b/src/util/network.c
index 9b61bd8c2..3ee19cfb2 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -66,7 +66,7 @@ struct GNUNET_NETWORK_TransmitHandle
66 /** 66 /**
67 * Our socket handle. 67 * Our socket handle.
68 */ 68 */
69 struct GNUNET_NETWORK_SocketHandle *sh; 69 struct GNUNET_NETWORK_ConnectionHandle *sh;
70 70
71 /** 71 /**
72 * Timeout for receiving (in absolute time). 72 * Timeout for receiving (in absolute time).
@@ -89,7 +89,7 @@ struct GNUNET_NETWORK_TransmitHandle
89/** 89/**
90 * @brief handle for a network socket 90 * @brief handle for a network socket
91 */ 91 */
92struct GNUNET_NETWORK_SocketHandle 92struct GNUNET_NETWORK_ConnectionHandle
93{ 93{
94 94
95 /** 95 /**
@@ -167,7 +167,7 @@ struct GNUNET_NETWORK_SocketHandle
167 GNUNET_SCHEDULER_TaskIdentifier write_task; 167 GNUNET_SCHEDULER_TaskIdentifier write_task;
168 168
169 /** 169 /**
170 * The handle we return for GNUNET_NETWORK_notify_transmit_ready. 170 * The handle we return for GNUNET_NETWORK_connection_notify_transmit_ready.
171 */ 171 */
172 struct GNUNET_NETWORK_TransmitHandle nth; 172 struct GNUNET_NETWORK_TransmitHandle nth;
173 173
@@ -217,13 +217,13 @@ struct GNUNET_NETWORK_SocketHandle
217 * 0 for sockets that need no write buffers, such as listen sockets) 217 * 0 for sockets that need no write buffers, such as listen sockets)
218 * @return the boxed socket handle 218 * @return the boxed socket handle
219 */ 219 */
220struct GNUNET_NETWORK_SocketHandle * 220struct GNUNET_NETWORK_ConnectionHandle *
221GNUNET_NETWORK_socket_create_from_existing (struct GNUNET_SCHEDULER_Handle 221GNUNET_NETWORK_connection_create_from_existing (struct GNUNET_SCHEDULER_Handle
222 *sched, int osSocket, 222 *sched, int osSocket,
223 size_t maxbuf) 223 size_t maxbuf)
224{ 224{
225 struct GNUNET_NETWORK_SocketHandle *ret; 225 struct GNUNET_NETWORK_ConnectionHandle *ret;
226 ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_SocketHandle) + maxbuf); 226 ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_ConnectionHandle) + maxbuf);
227 ret->write_buffer = (char *) &ret[1]; 227 ret->write_buffer = (char *) &ret[1];
228 ret->write_buffer_size = maxbuf; 228 ret->write_buffer_size = maxbuf;
229 ret->sock = osSocket; 229 ret->sock = osSocket;
@@ -244,14 +244,14 @@ GNUNET_NETWORK_socket_create_from_existing (struct GNUNET_SCHEDULER_Handle
244 * 0 for sockets that need no write buffers, such as listen sockets) 244 * 0 for sockets that need no write buffers, such as listen sockets)
245 * @return the socket handle, NULL on error 245 * @return the socket handle, NULL on error
246 */ 246 */
247struct GNUNET_NETWORK_SocketHandle * 247struct GNUNET_NETWORK_ConnectionHandle *
248GNUNET_NETWORK_socket_create_from_accept (struct GNUNET_SCHEDULER_Handle 248GNUNET_NETWORK_connection_create_from_accept (struct GNUNET_SCHEDULER_Handle
249 *sched, 249 *sched,
250 GNUNET_NETWORK_AccessCheck access, 250 GNUNET_NETWORK_AccessCheck access,
251 void *access_cls, int lsock, 251 void *access_cls, int lsock,
252 size_t maxbuf) 252 size_t maxbuf)
253{ 253{
254 struct GNUNET_NETWORK_SocketHandle *ret; 254 struct GNUNET_NETWORK_ConnectionHandle *ret;
255 char addr[32]; 255 char addr[32];
256 socklen_t addrlen; 256 socklen_t addrlen;
257 int fd; 257 int fd;
@@ -320,7 +320,7 @@ GNUNET_NETWORK_socket_create_from_accept (struct GNUNET_SCHEDULER_Handle
320 _("Accepting connection from `%s'\n"), 320 _("Accepting connection from `%s'\n"),
321 GNUNET_a2s(uaddr, addrlen)); 321 GNUNET_a2s(uaddr, addrlen));
322#endif 322#endif
323 ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_SocketHandle) + maxbuf); 323 ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_ConnectionHandle) + maxbuf);
324 ret->write_buffer = (char *) &ret[1]; 324 ret->write_buffer = (char *) &ret[1];
325 ret->write_buffer_size = maxbuf; 325 ret->write_buffer_size = maxbuf;
326 ret->addr = uaddr; 326 ret->addr = uaddr;
@@ -339,7 +339,7 @@ GNUNET_NETWORK_socket_create_from_accept (struct GNUNET_SCHEDULER_Handle
339 * @return GNUNET_OK on success 339 * @return GNUNET_OK on success
340 */ 340 */
341int 341int
342GNUNET_NETWORK_socket_get_address (struct GNUNET_NETWORK_SocketHandle *sock, 342GNUNET_NETWORK_connection_get_address (struct GNUNET_NETWORK_ConnectionHandle *sock,
343 void **addr, size_t * addrlen) 343 void **addr, size_t * addrlen)
344{ 344{
345 if ((sock->addr == NULL) || (sock->addrlen == 0)) 345 if ((sock->addr == NULL) || (sock->addrlen == 0))
@@ -414,7 +414,7 @@ socket_set_blocking (int handle, int doBlock)
414 * families as specified in the "address_families" array. 414 * families as specified in the "address_families" array.
415 */ 415 */
416static void 416static void
417try_lookup (struct GNUNET_NETWORK_SocketHandle *sock) 417try_lookup (struct GNUNET_NETWORK_ConnectionHandle *sock)
418{ 418{
419 struct addrinfo hints; 419 struct addrinfo hints;
420 int ec; 420 int ec;
@@ -446,7 +446,7 @@ try_lookup (struct GNUNET_NETWORK_SocketHandle *sock)
446 * @return GNUNET_SYSERR error (no more addresses to try) 446 * @return GNUNET_SYSERR error (no more addresses to try)
447 */ 447 */
448static int 448static int
449try_connect (struct GNUNET_NETWORK_SocketHandle *sock) 449try_connect (struct GNUNET_NETWORK_ConnectionHandle *sock)
450{ 450{
451 int s; 451 int s;
452 452
@@ -536,7 +536,7 @@ static void
536connect_continuation (void *cls, 536connect_continuation (void *cls,
537 const struct GNUNET_SCHEDULER_TaskContext *tc) 537 const struct GNUNET_SCHEDULER_TaskContext *tc)
538{ 538{
539 struct GNUNET_NETWORK_SocketHandle *sock = cls; 539 struct GNUNET_NETWORK_ConnectionHandle *sock = cls;
540 unsigned int len; 540 unsigned int len;
541 int error; 541 int error;
542 542
@@ -605,14 +605,14 @@ connect_continuation (void *cls,
605 * 0 for sockets that need no write buffers, such as listen sockets) 605 * 0 for sockets that need no write buffers, such as listen sockets)
606 * @return the socket handle 606 * @return the socket handle
607 */ 607 */
608struct GNUNET_NETWORK_SocketHandle * 608struct GNUNET_NETWORK_ConnectionHandle *
609GNUNET_NETWORK_socket_create_from_connect (struct GNUNET_SCHEDULER_Handle 609GNUNET_NETWORK_connection_create_from_connect (struct GNUNET_SCHEDULER_Handle
610 *sched, const char *hostname, 610 *sched, const char *hostname,
611 uint16_t port, size_t maxbuf) 611 uint16_t port, size_t maxbuf)
612{ 612{
613 struct GNUNET_NETWORK_SocketHandle *ret; 613 struct GNUNET_NETWORK_ConnectionHandle *ret;
614 614
615 ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_SocketHandle) + maxbuf); 615 ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_ConnectionHandle) + maxbuf);
616 ret->sock = -1; 616 ret->sock = -1;
617 ret->sched = sched; 617 ret->sched = sched;
618 ret->write_buffer = (char *) &ret[1]; 618 ret->write_buffer = (char *) &ret[1];
@@ -652,14 +652,14 @@ GNUNET_NETWORK_socket_create_from_connect (struct GNUNET_SCHEDULER_Handle
652 * 0 for sockets that need no write buffers, such as listen sockets) 652 * 0 for sockets that need no write buffers, such as listen sockets)
653 * @return the socket handle 653 * @return the socket handle
654 */ 654 */
655struct GNUNET_NETWORK_SocketHandle * 655struct GNUNET_NETWORK_ConnectionHandle *
656GNUNET_NETWORK_socket_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle 656GNUNET_NETWORK_connection_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle
657 *sched, int af_family, 657 *sched, int af_family,
658 const struct sockaddr *serv_addr, 658 const struct sockaddr *serv_addr,
659 socklen_t addrlen, size_t maxbuf) 659 socklen_t addrlen, size_t maxbuf)
660{ 660{
661 int s; 661 int s;
662 struct GNUNET_NETWORK_SocketHandle *ret; 662 struct GNUNET_NETWORK_ConnectionHandle *ret;
663 663
664 s = SOCKET (af_family, SOCK_STREAM, 0); 664 s = SOCKET (af_family, SOCK_STREAM, 0);
665 if (s == -1) 665 if (s == -1)
@@ -691,7 +691,7 @@ GNUNET_NETWORK_socket_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle
691 GNUNET_break (0 == CLOSE (s)); 691 GNUNET_break (0 == CLOSE (s));
692 return NULL; 692 return NULL;
693 } 693 }
694 ret = GNUNET_NETWORK_socket_create_from_existing (sched, s, maxbuf); 694 ret = GNUNET_NETWORK_connection_create_from_existing (sched, s, maxbuf);
695 ret->addr = GNUNET_malloc (addrlen); 695 ret->addr = GNUNET_malloc (addrlen);
696 memcpy (ret->addr, serv_addr, addrlen); 696 memcpy (ret->addr, serv_addr, addrlen);
697 ret->addrlen = addrlen; 697 ret->addrlen = addrlen;
@@ -708,7 +708,7 @@ GNUNET_NETWORK_socket_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle
708 * @return GNUNET_YES if valid, GNUNET_NO otherwise 708 * @return GNUNET_YES if valid, GNUNET_NO otherwise
709 */ 709 */
710int 710int
711GNUNET_NETWORK_socket_check (struct GNUNET_NETWORK_SocketHandle *sock) 711GNUNET_NETWORK_connection_check (struct GNUNET_NETWORK_ConnectionHandle *sock)
712{ 712{
713 if (sock->ai != NULL) 713 if (sock->ai != NULL)
714 return GNUNET_YES; /* still trying to connect */ 714 return GNUNET_YES; /* still trying to connect */
@@ -724,7 +724,7 @@ static void
724destroy_continuation (void *cls, 724destroy_continuation (void *cls,
725 const struct GNUNET_SCHEDULER_TaskContext *tc) 725 const struct GNUNET_SCHEDULER_TaskContext *tc)
726{ 726{
727 struct GNUNET_NETWORK_SocketHandle *sock = cls; 727 struct GNUNET_NETWORK_ConnectionHandle *sock = cls;
728 GNUNET_NETWORK_TransmitReadyNotify notify; 728 GNUNET_NETWORK_TransmitReadyNotify notify;
729 729
730 if (sock->write_task != GNUNET_SCHEDULER_NO_TASK) 730 if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
@@ -780,7 +780,7 @@ destroy_continuation (void *cls,
780 * @param sock socket to destroy 780 * @param sock socket to destroy
781 */ 781 */
782void 782void
783GNUNET_NETWORK_socket_destroy (struct GNUNET_NETWORK_SocketHandle *sock) 783GNUNET_NETWORK_connection_destroy (struct GNUNET_NETWORK_ConnectionHandle *sock)
784{ 784{
785 if (sock->write_buffer_off == 0) 785 if (sock->write_buffer_off == 0)
786 sock->ai_pos = NULL; /* if we're still trying to connect and have 786 sock->ai_pos = NULL; /* if we're still trying to connect and have
@@ -797,7 +797,7 @@ GNUNET_NETWORK_socket_destroy (struct GNUNET_NETWORK_SocketHandle *sock)
797 * Tell the receiver callback that a timeout was reached. 797 * Tell the receiver callback that a timeout was reached.
798 */ 798 */
799static void 799static void
800signal_timeout (struct GNUNET_NETWORK_SocketHandle *sh) 800signal_timeout (struct GNUNET_NETWORK_ConnectionHandle *sh)
801{ 801{
802 GNUNET_NETWORK_Receiver receiver; 802 GNUNET_NETWORK_Receiver receiver;
803 803
@@ -815,7 +815,7 @@ signal_timeout (struct GNUNET_NETWORK_SocketHandle *sh)
815 * Tell the receiver callback that we had an IO error. 815 * Tell the receiver callback that we had an IO error.
816 */ 816 */
817static void 817static void
818signal_error (struct GNUNET_NETWORK_SocketHandle *sh, int errcode) 818signal_error (struct GNUNET_NETWORK_ConnectionHandle *sh, int errcode)
819{ 819{
820 GNUNET_NETWORK_Receiver receiver; 820 GNUNET_NETWORK_Receiver receiver;
821 GNUNET_assert (NULL != (receiver = sh->receiver)); 821 GNUNET_assert (NULL != (receiver = sh->receiver));
@@ -831,7 +831,7 @@ signal_error (struct GNUNET_NETWORK_SocketHandle *sh, int errcode)
831static void 831static void
832receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 832receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
833{ 833{
834 struct GNUNET_NETWORK_SocketHandle *sh = cls; 834 struct GNUNET_NETWORK_ConnectionHandle *sh = cls;
835 struct GNUNET_TIME_Absolute now; 835 struct GNUNET_TIME_Absolute now;
836 char buffer[sh->max]; 836 char buffer[sh->max];
837 ssize_t ret; 837 ssize_t ret;
@@ -904,7 +904,7 @@ RETRY:
904static void 904static void
905receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 905receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
906{ 906{
907 struct GNUNET_NETWORK_SocketHandle *sh = cls; 907 struct GNUNET_NETWORK_ConnectionHandle *sh = cls;
908 struct GNUNET_TIME_Absolute now; 908 struct GNUNET_TIME_Absolute now;
909 909
910 sh->read_task = GNUNET_SCHEDULER_NO_TASK; 910 sh->read_task = GNUNET_SCHEDULER_NO_TASK;
@@ -968,7 +968,7 @@ receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
968 * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error 968 * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error
969 */ 969 */
970GNUNET_SCHEDULER_TaskIdentifier 970GNUNET_SCHEDULER_TaskIdentifier
971GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, 971GNUNET_NETWORK_connection_receive (struct GNUNET_NETWORK_ConnectionHandle *sock,
972 size_t max, 972 size_t max,
973 struct GNUNET_TIME_Relative timeout, 973 struct GNUNET_TIME_Relative timeout,
974 GNUNET_NETWORK_Receiver receiver, void *receiver_cls) 974 GNUNET_NETWORK_Receiver receiver, void *receiver_cls)
@@ -999,7 +999,7 @@ GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock,
999 * @return closure of the original receiver callback 999 * @return closure of the original receiver callback
1000 */ 1000 */
1001void * 1001void *
1002GNUNET_NETWORK_receive_cancel (struct GNUNET_NETWORK_SocketHandle *sock, 1002GNUNET_NETWORK_connection_receive_cancel (struct GNUNET_NETWORK_ConnectionHandle *sock,
1003 GNUNET_SCHEDULER_TaskIdentifier task) 1003 GNUNET_SCHEDULER_TaskIdentifier task)
1004{ 1004{
1005 GNUNET_assert (sock->read_task == task); 1005 GNUNET_assert (sock->read_task == task);
@@ -1018,7 +1018,7 @@ GNUNET_NETWORK_receive_cancel (struct GNUNET_NETWORK_SocketHandle *sock,
1018 * @return GNUNET_YES if we were able to call notify 1018 * @return GNUNET_YES if we were able to call notify
1019 */ 1019 */
1020static int 1020static int
1021process_notify (struct GNUNET_NETWORK_SocketHandle *sock) 1021process_notify (struct GNUNET_NETWORK_ConnectionHandle *sock)
1022{ 1022{
1023 size_t used; 1023 size_t used;
1024 size_t avail; 1024 size_t avail;
@@ -1067,7 +1067,7 @@ process_notify (struct GNUNET_NETWORK_SocketHandle *sock)
1067static void 1067static void
1068transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1068transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1069{ 1069{
1070 struct GNUNET_NETWORK_SocketHandle *sock = cls; 1070 struct GNUNET_NETWORK_ConnectionHandle *sock = cls;
1071 GNUNET_NETWORK_TransmitReadyNotify notify; 1071 GNUNET_NETWORK_TransmitReadyNotify notify;
1072 1072
1073#if DEBUG_NETWORK 1073#if DEBUG_NETWORK
@@ -1080,7 +1080,7 @@ transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1080 1080
1081 1081
1082static void 1082static void
1083transmit_error (struct GNUNET_NETWORK_SocketHandle *sock) 1083transmit_error (struct GNUNET_NETWORK_ConnectionHandle *sock)
1084{ 1084{
1085 if (sock->nth.notify_ready == NULL) 1085 if (sock->nth.notify_ready == NULL)
1086 return; /* nobody to tell about it */ 1086 return; /* nobody to tell about it */
@@ -1101,7 +1101,7 @@ transmit_error (struct GNUNET_NETWORK_SocketHandle *sock)
1101static void 1101static void
1102transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1102transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1103{ 1103{
1104 struct GNUNET_NETWORK_SocketHandle *sock = cls; 1104 struct GNUNET_NETWORK_ConnectionHandle *sock = cls;
1105 ssize_t ret; 1105 ssize_t ret;
1106 size_t have; 1106 size_t have;
1107 1107
@@ -1221,7 +1221,7 @@ SCHEDULE_WRITE:
1221 * NULL if we are already going to notify someone else (busy) 1221 * NULL if we are already going to notify someone else (busy)
1222 */ 1222 */
1223struct GNUNET_NETWORK_TransmitHandle * 1223struct GNUNET_NETWORK_TransmitHandle *
1224GNUNET_NETWORK_notify_transmit_ready (struct GNUNET_NETWORK_SocketHandle 1224GNUNET_NETWORK_connection_notify_transmit_ready (struct GNUNET_NETWORK_ConnectionHandle
1225 *sock, size_t size, 1225 *sock, size_t size,
1226 struct GNUNET_TIME_Relative timeout, 1226 struct GNUNET_TIME_Relative timeout,
1227 GNUNET_NETWORK_TransmitReadyNotify 1227 GNUNET_NETWORK_TransmitReadyNotify
@@ -1285,7 +1285,7 @@ GNUNET_NETWORK_notify_transmit_ready (struct GNUNET_NETWORK_SocketHandle
1285 * notification. 1285 * notification.
1286 */ 1286 */
1287void 1287void
1288GNUNET_NETWORK_notify_transmit_ready_cancel (struct 1288GNUNET_NETWORK_connection_notify_transmit_ready_cancel (struct
1289 GNUNET_NETWORK_TransmitHandle *h) 1289 GNUNET_NETWORK_TransmitHandle *h)
1290{ 1290{
1291 GNUNET_assert (h->notify_ready != NULL); 1291 GNUNET_assert (h->notify_ready != NULL);
diff --git a/src/util/server.c b/src/util/server.c
index 8ffc9c027..d518cbeec 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -312,7 +312,7 @@ process_listen_socket (void *cls,
312 const struct GNUNET_SCHEDULER_TaskContext *tc) 312 const struct GNUNET_SCHEDULER_TaskContext *tc)
313{ 313{
314 struct GNUNET_SERVER_Handle *server = cls; 314 struct GNUNET_SERVER_Handle *server = cls;
315 struct GNUNET_NETWORK_SocketHandle *sock; 315 struct GNUNET_NETWORK_ConnectionHandle *sock;
316 struct GNUNET_SERVER_Client *client; 316 struct GNUNET_SERVER_Client *client;
317 fd_set r; 317 fd_set r;
318 318
@@ -329,7 +329,7 @@ process_listen_socket (void *cls,
329 } 329 }
330 GNUNET_assert (FD_ISSET (server->listen_socket, tc->read_ready)); 330 GNUNET_assert (FD_ISSET (server->listen_socket, tc->read_ready));
331 GNUNET_assert (!FD_ISSET (server->shutpipe[0], tc->read_ready)); 331 GNUNET_assert (!FD_ISSET (server->shutpipe[0], tc->read_ready));
332 sock = GNUNET_NETWORK_socket_create_from_accept (tc->sched, 332 sock = GNUNET_NETWORK_connection_create_from_accept (tc->sched,
333 server->access, 333 server->access,
334 server->access_cls, 334 server->access_cls,
335 server->listen_socket, 335 server->listen_socket,
@@ -867,20 +867,20 @@ sock_receive (void *cls,
867 struct GNUNET_TIME_Relative timeout, 867 struct GNUNET_TIME_Relative timeout,
868 GNUNET_NETWORK_Receiver receiver, void *receiver_cls) 868 GNUNET_NETWORK_Receiver receiver, void *receiver_cls)
869{ 869{
870 return GNUNET_NETWORK_receive (cls, max, timeout, receiver, receiver_cls); 870 return GNUNET_NETWORK_connection_receive (cls, max, timeout, receiver, receiver_cls);
871} 871}
872 872
873 873
874/** 874/**
875 * Wrapper to cancel receiving from a socket. 875 * Wrapper to cancel receiving from a socket.
876 * 876 *
877 * @param cls handle to the GNUNET_NETWORK_SocketHandle to cancel 877 * @param cls handle to the GNUNET_NETWORK_ConnectionHandle to cancel
878 * @param tc task ID that was returned by GNUNET_NETWORK_receive 878 * @param tc task ID that was returned by GNUNET_NETWORK_connection_receive
879 */ 879 */
880static void 880static void
881sock_receive_cancel (void *cls, GNUNET_SCHEDULER_TaskIdentifier ti) 881sock_receive_cancel (void *cls, GNUNET_SCHEDULER_TaskIdentifier ti)
882{ 882{
883 GNUNET_NETWORK_receive_cancel (cls, ti); 883 GNUNET_NETWORK_connection_receive_cancel (cls, ti);
884} 884}
885 885
886 886
@@ -894,7 +894,7 @@ sock_notify_transmit_ready (void *cls,
894 GNUNET_NETWORK_TransmitReadyNotify notify, 894 GNUNET_NETWORK_TransmitReadyNotify notify,
895 void *notify_cls) 895 void *notify_cls)
896{ 896{
897 return GNUNET_NETWORK_notify_transmit_ready (cls, size, timeout, notify, 897 return GNUNET_NETWORK_connection_notify_transmit_ready (cls, size, timeout, notify,
898 notify_cls); 898 notify_cls);
899} 899}
900 900
@@ -905,7 +905,7 @@ sock_notify_transmit_ready (void *cls,
905static void 905static void
906sock_notify_transmit_ready_cancel (void *cls, void *h) 906sock_notify_transmit_ready_cancel (void *cls, void *h)
907{ 907{
908 GNUNET_NETWORK_notify_transmit_ready_cancel (h); 908 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (h);
909} 909}
910 910
911 911
@@ -918,7 +918,7 @@ sock_notify_transmit_ready_cancel (void *cls, void *h)
918static int 918static int
919sock_check (void *cls) 919sock_check (void *cls)
920{ 920{
921 return GNUNET_NETWORK_socket_check (cls); 921 return GNUNET_NETWORK_connection_check (cls);
922} 922}
923 923
924 924
@@ -930,7 +930,7 @@ sock_check (void *cls)
930static void 930static void
931sock_destroy (void *cls) 931sock_destroy (void *cls)
932{ 932{
933 GNUNET_NETWORK_socket_destroy (cls); 933 GNUNET_NETWORK_connection_destroy (cls);
934} 934}
935 935
936 936
@@ -950,7 +950,7 @@ struct GNUNET_SERVER_Client *
950GNUNET_SERVER_connect_socket (struct 950GNUNET_SERVER_connect_socket (struct
951 GNUNET_SERVER_Handle 951 GNUNET_SERVER_Handle
952 *server, 952 *server,
953 struct GNUNET_NETWORK_SocketHandle *connection) 953 struct GNUNET_NETWORK_ConnectionHandle *connection)
954{ 954{
955 struct GNUNET_SERVER_Client *client; 955 struct GNUNET_SERVER_Client *client;
956 956
@@ -1064,7 +1064,7 @@ GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client,
1064{ 1064{
1065 if (client->receive != &sock_receive) 1065 if (client->receive != &sock_receive)
1066 return GNUNET_SYSERR; /* not a network client */ 1066 return GNUNET_SYSERR; /* not a network client */
1067 return GNUNET_NETWORK_socket_get_address (client->client_closure, 1067 return GNUNET_NETWORK_connection_get_address (client->client_closure,
1068 addr, addrlen); 1068 addr, addrlen);
1069} 1069}
1070 1070
@@ -1127,7 +1127,7 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client)
1127 * @param callback_cls closure for callback 1127 * @param callback_cls closure for callback
1128 * @return non-NULL if the notify callback was queued; can be used 1128 * @return non-NULL if the notify callback was queued; can be used
1129 * to cancel the request using 1129 * to cancel the request using
1130 * GNUNET_NETWORK_notify_transmit_ready_cancel. 1130 * GNUNET_NETWORK_connection_notify_transmit_ready_cancel.
1131 * NULL if we are already going to notify someone else (busy) 1131 * NULL if we are already going to notify someone else (busy)
1132 */ 1132 */
1133struct GNUNET_NETWORK_TransmitHandle * 1133struct GNUNET_NETWORK_TransmitHandle *
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
35static struct GNUNET_NETWORK_SocketHandle *csock; 35static struct GNUNET_NETWORK_ConnectionHandle *csock;
36 36
37static struct GNUNET_NETWORK_SocketHandle *asock; 37static struct GNUNET_NETWORK_ConnectionHandle *asock;
38 38
39static struct GNUNET_NETWORK_SocketHandle *lsock; 39static struct GNUNET_NETWORK_ConnectionHandle *lsock;
40 40
41static size_t sofar; 41static 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
146task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 146task (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
diff --git a/src/util/test_network_addressing.c b/src/util/test_network_addressing.c
index 3c2a690d9..aeb187634 100644
--- a/src/util/test_network_addressing.c
+++ b/src/util/test_network_addressing.c
@@ -32,11 +32,11 @@
32#define PORT 12435 32#define PORT 12435
33 33
34 34
35static struct GNUNET_NETWORK_SocketHandle *csock; 35static struct GNUNET_NETWORK_ConnectionHandle *csock;
36 36
37static struct GNUNET_NETWORK_SocketHandle *asock; 37static struct GNUNET_NETWORK_ConnectionHandle *asock;
38 38
39static struct GNUNET_NETWORK_SocketHandle *lsock; 39static struct GNUNET_NETWORK_ConnectionHandle *lsock;
40 40
41static size_t sofar; 41static size_t sofar;
42 42
@@ -82,7 +82,7 @@ receive_check (void *cls,
82 sofar += available; 82 sofar += available;
83 if (sofar < 12) 83 if (sofar < 12)
84 { 84 {
85 GNUNET_NETWORK_receive (asock, 85 GNUNET_NETWORK_connection_receive (asock,
86 1024, 86 1024,
87 GNUNET_TIME_relative_multiply 87 GNUNET_TIME_relative_multiply
88 (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, 88 (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
@@ -91,7 +91,7 @@ receive_check (void *cls,
91 else 91 else
92 { 92 {
93 *ok = 0; 93 *ok = 0;
94 GNUNET_NETWORK_socket_destroy (asock); 94 GNUNET_NETWORK_connection_destroy (asock);
95 } 95 }
96} 96}
97 97
@@ -104,12 +104,12 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104 struct sockaddr_in *v4; 104 struct sockaddr_in *v4;
105 struct sockaddr_in expect; 105 struct sockaddr_in expect;
106 106
107 asock = GNUNET_NETWORK_socket_create_from_accept (tc->sched, 107 asock = GNUNET_NETWORK_connection_create_from_accept (tc->sched,
108 NULL, NULL, ls, 1024); 108 NULL, NULL, ls, 1024);
109 GNUNET_assert (asock != NULL); 109 GNUNET_assert (asock != NULL);
110 GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_socket_check (asock)); 110 GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_connection_check (asock));
111 GNUNET_assert (GNUNET_OK == 111 GNUNET_assert (GNUNET_OK ==
112 GNUNET_NETWORK_socket_get_address (asock, &addr, &alen)); 112 GNUNET_NETWORK_connection_get_address (asock, &addr, &alen));
113 GNUNET_assert (alen == sizeof (struct sockaddr_in)); 113 GNUNET_assert (alen == sizeof (struct sockaddr_in));
114 v4 = addr; 114 v4 = addr;
115 memset (&expect, 0, sizeof (expect)); 115 memset (&expect, 0, sizeof (expect));
@@ -118,8 +118,8 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118 expect.sin_addr.s_addr = htonl (INADDR_LOOPBACK); 118 expect.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
119 GNUNET_assert (0 == memcmp (&expect, v4, alen)); 119 GNUNET_assert (0 == memcmp (&expect, v4, alen));
120 GNUNET_free (addr); 120 GNUNET_free (addr);
121 GNUNET_NETWORK_socket_destroy (lsock); 121 GNUNET_NETWORK_connection_destroy (lsock);
122 GNUNET_NETWORK_receive (asock, 122 GNUNET_NETWORK_connection_receive (asock,
123 1024, 123 1024,
124 GNUNET_TIME_relative_multiply 124 GNUNET_TIME_relative_multiply
125 (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); 125 (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls);
@@ -138,24 +138,24 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138{ 138{
139 struct sockaddr_in v4; 139 struct sockaddr_in v4;
140 ls = open_listen_socket (); 140 ls = open_listen_socket ();
141 lsock = GNUNET_NETWORK_socket_create_from_existing (tc->sched, ls, 0); 141 lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0);
142 GNUNET_assert (lsock != NULL); 142 GNUNET_assert (lsock != NULL);
143 143
144 v4.sin_family = AF_INET; 144 v4.sin_family = AF_INET;
145 v4.sin_port = htons (PORT); 145 v4.sin_port = htons (PORT);
146 v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); 146 v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
147 csock = GNUNET_NETWORK_socket_create_from_sockaddr (tc->sched, 147 csock = GNUNET_NETWORK_connection_create_from_sockaddr (tc->sched,
148 AF_INET, 148 AF_INET,
149 (const struct sockaddr 149 (const struct sockaddr
150 *) &v4, sizeof (v4), 150 *) &v4, sizeof (v4),
151 1024); 151 1024);
152 GNUNET_assert (csock != NULL); 152 GNUNET_assert (csock != NULL);
153 GNUNET_assert (NULL != 153 GNUNET_assert (NULL !=
154 GNUNET_NETWORK_notify_transmit_ready (csock, 154 GNUNET_NETWORK_connection_notify_transmit_ready (csock,
155 12, 155 12,
156 GNUNET_TIME_UNIT_SECONDS, 156 GNUNET_TIME_UNIT_SECONDS,
157 &make_hello, NULL)); 157 &make_hello, NULL));
158 GNUNET_NETWORK_socket_destroy (csock); 158 GNUNET_NETWORK_connection_destroy (csock);
159 GNUNET_SCHEDULER_add_read (tc->sched, 159 GNUNET_SCHEDULER_add_read (tc->sched,
160 GNUNET_NO, 160 GNUNET_NO,
161 GNUNET_SCHEDULER_PRIORITY_HIGH, 161 GNUNET_SCHEDULER_PRIORITY_HIGH,
diff --git a/src/util/test_network_receive_cancel.c b/src/util/test_network_receive_cancel.c
index 7eb31153c..51d8350af 100644
--- a/src/util/test_network_receive_cancel.c
+++ b/src/util/test_network_receive_cancel.c
@@ -32,11 +32,11 @@
32#define PORT 12435 32#define PORT 12435
33 33
34 34
35static struct GNUNET_NETWORK_SocketHandle *csock; 35static struct GNUNET_NETWORK_ConnectionHandle *csock;
36 36
37static struct GNUNET_NETWORK_SocketHandle *asock; 37static struct GNUNET_NETWORK_ConnectionHandle *asock;
38 38
39static struct GNUNET_NETWORK_SocketHandle *lsock; 39static struct GNUNET_NETWORK_ConnectionHandle *lsock;
40 40
41static int ls; 41static int ls;
42 42
@@ -85,13 +85,13 @@ static void
85run_accept_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 85run_accept_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86{ 86{
87 87
88 asock = GNUNET_NETWORK_socket_create_from_accept (tc->sched, 88 asock = GNUNET_NETWORK_connection_create_from_accept (tc->sched,
89 NULL, NULL, ls, 1024); 89 NULL, NULL, ls, 1024);
90 GNUNET_assert (asock != NULL); 90 GNUNET_assert (asock != NULL);
91 GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_socket_check (asock)); 91 GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_connection_check (asock));
92 GNUNET_NETWORK_socket_destroy (lsock); 92 GNUNET_NETWORK_connection_destroy (lsock);
93 receive_task 93 receive_task
94 = GNUNET_NETWORK_receive (asock, 94 = GNUNET_NETWORK_connection_receive (asock,
95 1024, 95 1024,
96 GNUNET_TIME_relative_multiply 96 GNUNET_TIME_relative_multiply
97 (GNUNET_TIME_UNIT_SECONDS, 5), &dead_receive, 97 (GNUNET_TIME_UNIT_SECONDS, 5), &dead_receive,
@@ -103,9 +103,9 @@ static void
103receive_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 103receive_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104{ 104{
105 int *ok = cls; 105 int *ok = cls;
106 GNUNET_NETWORK_receive_cancel (asock, receive_task); 106 GNUNET_NETWORK_connection_receive_cancel (asock, receive_task);
107 GNUNET_NETWORK_socket_destroy (csock); 107 GNUNET_NETWORK_connection_destroy (csock);
108 GNUNET_NETWORK_socket_destroy (asock); 108 GNUNET_NETWORK_connection_destroy (asock);
109 *ok = 0; 109 *ok = 0;
110} 110}
111 111
@@ -115,9 +115,9 @@ static void
115task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 115task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
116{ 116{
117 ls = open_listen_socket (); 117 ls = open_listen_socket ();
118 lsock = GNUNET_NETWORK_socket_create_from_existing (tc->sched, ls, 0); 118 lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0);
119 GNUNET_assert (lsock != NULL); 119 GNUNET_assert (lsock != NULL);
120 csock = GNUNET_NETWORK_socket_create_from_connect (tc->sched, 120 csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched,
121 "localhost", PORT, 1024); 121 "localhost", PORT, 1024);
122 GNUNET_assert (csock != NULL); 122 GNUNET_assert (csock != NULL);
123 GNUNET_SCHEDULER_add_read (tc->sched, 123 GNUNET_SCHEDULER_add_read (tc->sched,
diff --git a/src/util/test_network_timeout.c b/src/util/test_network_timeout.c
index 2c2f6f9f2..1d8910842 100644
--- a/src/util/test_network_timeout.c
+++ b/src/util/test_network_timeout.c
@@ -31,9 +31,9 @@
31 31
32#define PORT 12435 32#define PORT 12435
33 33
34static struct GNUNET_NETWORK_SocketHandle *csock; 34static struct GNUNET_NETWORK_ConnectionHandle *csock;
35 35
36static struct GNUNET_NETWORK_SocketHandle *lsock; 36static struct GNUNET_NETWORK_ConnectionHandle *lsock;
37 37
38static int ls; 38static int ls;
39 39
@@ -74,8 +74,8 @@ send_kilo (void *cls, size_t size, void *buf)
74#endif 74#endif
75 GNUNET_assert (buf == NULL); 75 GNUNET_assert (buf == NULL);
76 *ok = 0; 76 *ok = 0;
77 GNUNET_NETWORK_socket_destroy (lsock); 77 GNUNET_NETWORK_connection_destroy (lsock);
78 GNUNET_NETWORK_socket_destroy (csock); 78 GNUNET_NETWORK_connection_destroy (csock);
79 return 0; 79 return 0;
80 } 80 }
81#if VERBOSE 81#if VERBOSE
@@ -85,7 +85,7 @@ send_kilo (void *cls, size_t size, void *buf)
85 memset (buf, 42, 1024); 85 memset (buf, 42, 1024);
86 86
87 GNUNET_assert (NULL != 87 GNUNET_assert (NULL !=
88 GNUNET_NETWORK_notify_transmit_ready (csock, 88 GNUNET_NETWORK_connection_notify_transmit_ready (csock,
89 1024, 89 1024,
90 GNUNET_TIME_UNIT_SECONDS, 90 GNUNET_TIME_UNIT_SECONDS,
91 &send_kilo, cls)); 91 &send_kilo, cls));
@@ -98,13 +98,13 @@ task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
98{ 98{
99 99
100 ls = open_listen_socket (); 100 ls = open_listen_socket ();
101 lsock = GNUNET_NETWORK_socket_create_from_existing (tc->sched, ls, 0); 101 lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0);
102 GNUNET_assert (lsock != NULL); 102 GNUNET_assert (lsock != NULL);
103 csock = GNUNET_NETWORK_socket_create_from_connect (tc->sched, 103 csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched,
104 "localhost", PORT, 1024); 104 "localhost", PORT, 1024);
105 GNUNET_assert (csock != NULL); 105 GNUNET_assert (csock != NULL);
106 GNUNET_assert (NULL != 106 GNUNET_assert (NULL !=
107 GNUNET_NETWORK_notify_transmit_ready (csock, 107 GNUNET_NETWORK_connection_notify_transmit_ready (csock,
108 1024, 108 1024,
109 GNUNET_TIME_UNIT_SECONDS, 109 GNUNET_TIME_UNIT_SECONDS,
110 &send_kilo, cls)); 110 &send_kilo, cls));
diff --git a/src/util/test_network_timeout_no_connect.c b/src/util/test_network_timeout_no_connect.c
index fd5e82dcd..172a6991d 100644
--- a/src/util/test_network_timeout_no_connect.c
+++ b/src/util/test_network_timeout_no_connect.c
@@ -31,7 +31,7 @@
31 31
32#define PORT 13425 32#define PORT 13425
33 33
34static struct GNUNET_NETWORK_SocketHandle *csock; 34static struct GNUNET_NETWORK_ConnectionHandle *csock;
35 35
36static size_t 36static size_t
37handle_timeout (void *cls, size_t size, void *buf) 37handle_timeout (void *cls, size_t size, void *buf)
@@ -51,11 +51,11 @@ handle_timeout (void *cls, size_t size, void *buf)
51static void 51static void
52task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 52task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
53{ 53{
54 csock = GNUNET_NETWORK_socket_create_from_connect (tc->sched, 54 csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched,
55 "localhost", PORT, 1024); 55 "localhost", PORT, 1024);
56 GNUNET_assert (csock != NULL); 56 GNUNET_assert (csock != NULL);
57 GNUNET_assert (NULL != 57 GNUNET_assert (NULL !=
58 GNUNET_NETWORK_notify_transmit_ready (csock, 58 GNUNET_NETWORK_connection_notify_transmit_ready (csock,
59 1024, 59 1024,
60 GNUNET_TIME_UNIT_SECONDS, 60 GNUNET_TIME_UNIT_SECONDS,
61 &handle_timeout, cls)); 61 &handle_timeout, cls));
diff --git a/src/util/test_network_transmit_cancel.c b/src/util/test_network_transmit_cancel.c
index 802f9a477..7a67000a8 100644
--- a/src/util/test_network_transmit_cancel.c
+++ b/src/util/test_network_transmit_cancel.c
@@ -46,17 +46,17 @@ task_transmit_cancel (void *cls,
46{ 46{
47 int *ok = cls; 47 int *ok = cls;
48 struct GNUNET_NETWORK_TransmitHandle *th; 48 struct GNUNET_NETWORK_TransmitHandle *th;
49 struct GNUNET_NETWORK_SocketHandle *csock; 49 struct GNUNET_NETWORK_ConnectionHandle *csock;
50 50
51 csock = GNUNET_NETWORK_socket_create_from_connect (tc->sched, 51 csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched,
52 "localhost", PORT, 1024); 52 "localhost", PORT, 1024);
53 GNUNET_assert (csock != NULL); 53 GNUNET_assert (csock != NULL);
54 th = GNUNET_NETWORK_notify_transmit_ready (csock, 54 th = GNUNET_NETWORK_connection_notify_transmit_ready (csock,
55 12, 55 12,
56 GNUNET_TIME_UNIT_MINUTES, 56 GNUNET_TIME_UNIT_MINUTES,
57 &not_run, cls); 57 &not_run, cls);
58 GNUNET_NETWORK_notify_transmit_ready_cancel (th); 58 GNUNET_NETWORK_connection_notify_transmit_ready_cancel (th);
59 GNUNET_NETWORK_socket_destroy (csock); 59 GNUNET_NETWORK_connection_destroy (csock);
60 *ok = 0; 60 *ok = 0;
61} 61}
62 62