summaryrefslogtreecommitdiff
path: root/tests/network/test_proactor.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/network/test_proactor.c')
-rw-r--r--tests/network/test_proactor.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/network/test_proactor.c b/tests/network/test_proactor.c
index fc44b13..2d998cc 100644
--- a/tests/network/test_proactor.c
+++ b/tests/network/test_proactor.c
@@ -19,8 +19,13 @@ typedef struct wolf_asio_completion_dispatcher_t *wolf_asio_completion_dispatche
* - the Acceptor: accepts new connections arsynchronously
* - the Protocol Handler: handles all the communication with the
* other peer, it should never do long synchronous work!
+ * - per operation there is one specialized handler, so we can pass
+ * aynchronous request data to it
*/
-typedef void(*wolf_asio_completion_handler_f)( void );
+typedef void(*wolf_asio_write_completion_handler_f)( void );
+typedef void(*wolf_asio_read_completion_handler_f)( void );
+typedef void(*wolf_asio_accept_completion_handler_f)( void );
+typedef void(*wolf_asio_connect_completion_handler_f)( void );
/* Asynchronous Operation Processor (asio_proc):
* - performs the asynchronous opreation on behalf of the application,
@@ -51,14 +56,19 @@ wolf_error_t wolf_asio_proc_free( wolf_asio_proc_p proc );
wolf_error_t wolf_asio_proc_write( wolf_asio_proc_p proc,
char *buf,
- size_t buflen );
+ size_t buflen,
+ wolf_asio_write_completion_handler_f completion_handler );
wolf_error_t wolf_asio_proc_read( wolf_asio_proc_p proc,
char *buf,
- size_t buflen );
+ size_t buflen,
+ wolf_asio_read_completion_handler_f completion_handler );
wolf_error_t wolf_asio_proc_accept( wolf_asio_proc_p proc,
- wolf_asio_completion_handler_f completion_handler );
+ wolf_asio_accept_completion_handler_f completion_handler );
+
+wolf_error_t wolf_asio_proc_connect( wolf_asio_proc_p proc,
+ wolf_asio_connect_completion_handler_f completion_handler );
/**
* Acceptor
@@ -125,7 +135,7 @@ wolf_error_t wolf_asio_proc_free( wolf_asio_proc_p proc ) {
}
wolf_error_t wolf_asio_proc_accept( wolf_asio_proc_p proc,
- wolf_asio_completion_handler_f completion_handler ) {
+ wolf_asio_accept_completion_handler_f completion_handler ) {
WOLF_UNUSED( proc );
WOLF_UNUSED( completion_handler );