Listener
[IO]

**Unsettled API** - A listener for incoming connections. More...

Typedefs

typedef struct pn_listener_t pn_listener_t
 A listener for incoming connections.

Functions

PNP_EXTERN pn_listener_tpn_listener (void)
 Create a listener to pass to pn_proactor_listen().
PNP_EXTERN void pn_listener_free (pn_listener_t *l)
 Free a listener.
PNP_EXTERN void pn_listener_accept (pn_listener_t *, pn_connection_t *)
 Bind connection to a new transport accepted from listener.
PNP_EXTERN pn_condition_tpn_listener_condition (pn_listener_t *l)
 Get the error condition for a listener.
PNP_EXTERN pn_record_t * pn_listener_attachments (pn_listener_t *listener)
 Get the attachments that are associated with a listener object.
PNP_EXTERN void pn_listener_close (pn_listener_t *l)
 Close the listener.
PNP_EXTERN pn_proactor_tpn_listener_proactor (pn_listener_t *c)
 The proactor associated with a listener.
PNP_EXTERN pn_listener_tpn_event_listener (pn_event_t *event)
 Return the listener associated with an event.

Detailed Description

**Unsettled API** - A listener for incoming connections.

Note:
Thread safety: Listener has the same thread-safety rules as a Core object. Calls to a single listener must be serialized with the exception of pn_listener_close().

Function Documentation

PNP_EXTERN pn_listener_t* pn_listener ( void   ) 

Create a listener to pass to pn_proactor_listen().

You can use pn_listener_attachments() to set application data that can be accessed when accepting connections.

Examples:
broker.c, and direct.c.
PNP_EXTERN void pn_listener_free ( pn_listener_t l  ) 

Free a listener.

You don't need to call this unless you create a listener with pn_listen() but never pass it to pn_proactor_listen()

PNP_EXTERN void pn_listener_accept ( pn_listener_t ,
pn_connection_t  
)

Bind connection to a new transport accepted from listener.

Errors are returned as PN_TRANSPORT_CLOSED events by pn_proactor_wait().

Examples:
broker.c, and direct.c.
PNP_EXTERN void pn_listener_close ( pn_listener_t l  ) 

Close the listener.

The PN_LISTENER_CLOSE event is generated when the listener has stopped listening.

Note:
Thread safe. Must not be called after the PN_LISTENER_CLOSE event has been handled as the listener may be freed .
Examples:
direct.c.
PNP_EXTERN pn_listener_t* pn_event_listener ( pn_event_t event  ) 

Return the listener associated with an event.

Returns:
NULL if the event is not associated with a listener.
Examples:
broker.c, and direct.c.

Generated on 28 Nov 2017 for Qpid Proton C by  doxygen 1.6.1