Qpid Proton C API 0.41.1
Loading...
Searching...
No Matches
proactor_ext.h

Extended proactor functions for native or implementation-specific integration. More...

#include <proton/import_export.h>
#include <proton/types.h>

Go to the source code of this file.

Typedefs

typedef int pn_socket_t

Functions

PNP_EXTERN void pn_proactor_import_socket (pn_proactor_t *proactor, pn_connection_t *connection, pn_transport_t *transport, pn_socket_t fd)
 Import an existing connected socket into the proactor and bind to a connection and transport.

Detailed Description

Extended proactor functions for native or implementation-specific integration.

Function Documentation

◆ pn_proactor_import_socket()

PNP_EXTERN void pn_proactor_import_socket ( pn_proactor_t * proactor,
pn_connection_t * connection,
pn_transport_t * transport,
pn_socket_t fd )

Import an existing connected socket into the proactor and bind to a connection and transport.

Errors are returned as PN_TRANSPORT_CLOSED events by pn_proactor_wait().

The proactor takes ownership of connection and will automatically call pn_connection_free() after the final PN_TRANSPORT_CLOSED event is handled, or when pn_proactor_free() is called. You can prevent the automatic free with pn_proactor_release_connection()

The proactor takes ownership of transport, it will be freed even if pn_proactor_release_connection() is called.

The proactor takes ownership of the socket and will close it when the connection is closed.

Note
Thread-safe
Parameters
[in]ProactorThe proactor object.
[in]ConnectionThe connection object, or NULL to create a new one.
[in]TransportThe transport object, or NULL to create a new one.
[in]fdThe file descriptor or socket handle of the connected socket.