From 424c2238c97d26d8d5fb30fb1449a96396269da0 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 2 Jul 2017 12:58:53 -0700 Subject: Transports allocate their pipe structures during connect & accept. --- src/core/transport.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/core/transport.h') diff --git a/src/core/transport.h b/src/core/transport.h index d965201a..0ec7310a 100644 --- a/src/core/transport.h +++ b/src/core/transport.h @@ -49,9 +49,9 @@ struct nni_tran_ep { // ep_connect establishes a connection. It can return errors // NNG_EACCESS, NNG_ECONNREFUSED, NNG_EBADADDR, NNG_ECONNFAILED, // NNG_ETIMEDOUT, and NNG_EPROTO. The first argument is the - // transport specific endpoint, and the second is the transport - // specific pipe structure. - int (*ep_connect)(void *, void *); + // transport specific endpoint, and the second is a pointer to + // receive a newly created transport-specific pipe structure. + int (*ep_connect)(void *, void **); // ep_bind just does the bind() and listen() work, // reserving the address but not creating any connections. @@ -61,9 +61,9 @@ struct nni_tran_ep { int (*ep_bind)(void *); // ep_accept accepts an inbound connection. The first argument - // is the transport-specific endpoint, and the second is the - // transport-specific pipe (which will have already been created.) - int (*ep_accept)(void *, void *); + // is the transport-specific endpoint, and the second is a pointer to + // a transport-specific pipe, created by this function. + int (*ep_accept)(void *, void **); // ep_close stops the endpoint from operating altogether. It does // not affect pipes that have already been created. @@ -81,9 +81,6 @@ struct nni_tran_ep { // back into the socket at this point. (Which is one reason pointers back // to socket or even enclosing pipe state, are not provided.) struct nni_tran_pipe { - // p_init initializes the pipe structure, allocating the structure. - int (*p_init)(void **); - // p_fini destroys the pipe. This should clean up all local // resources, including closing files and freeing memory, used by // the pipe. After this call returns, the system will not make -- cgit v1.2.3-70-g09d2