From 8811317e2da3b5a21d6caab0cc0e12aad417edd6 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 5 Jul 2017 20:22:36 -0700 Subject: Make ipc work 100% async. The connect & accept logic for IPC is now fully asynchronous. This will serve as a straight-forward template for TCP. Note that the upper logic still uses a thread to run this "synchronously", but that will be able to be removed once the last transport (TCP) is made fully async. The unified ipcsock is also now separated, and we anticipate being able to remove the posix_sock.c logic shortly. Separating out the endpoint logic from the pipe logic helps makes things clearer, and may faciliate a day where endpoints have multiple addresses (for example with a connect() endpoint that uses a round-robin DNS list and tries to run the entire list in parallel, stopping with the first connection made.) The platform header got a little cleanup while we were here. --- src/platform/posix/posix_aio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/platform/posix/posix_aio.h') diff --git a/src/platform/posix/posix_aio.h b/src/platform/posix/posix_aio.h index 186f586f..13559c08 100644 --- a/src/platform/posix/posix_aio.h +++ b/src/platform/posix/posix_aio.h @@ -30,10 +30,14 @@ extern void nni_posix_pipedesc_recv(nni_posix_pipedesc *, nni_aio *); extern void nni_posix_pipedesc_send(nni_posix_pipedesc *, nni_aio *); extern void nni_posix_pipedesc_close(nni_posix_pipedesc *); -extern int nni_posix_epdesc_init(nni_posix_epdesc **, int); +extern int nni_posix_epdesc_init(nni_posix_epdesc **, const char *); +extern const char *nni_posix_epdesc_url(nni_posix_epdesc *); +extern void nni_posix_epdesc_set_local(nni_posix_epdesc *, void *, int); +extern void nni_posix_epdesc_set_remote(nni_posix_epdesc *, void *, int); extern void nni_posix_epdesc_fini(nni_posix_epdesc *); extern void nni_posix_epdesc_close(nni_posix_epdesc *); extern void nni_posix_epdesc_connect(nni_posix_epdesc *, nni_aio *); +extern int nni_posix_epdesc_listen(nni_posix_epdesc *); extern void nni_posix_epdesc_accept(nni_posix_epdesc *, nni_aio *); #endif // PLATFORM_POSIX_AIO_H -- cgit v1.2.3-70-g09d2