Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
#ifndef PROTON_EVENT_H
#define PROTON_EVENT_H 1
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include <proton/import_export.h>
#include <proton/type_compat.h>
#include <proton/object.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct pn_event_t pn_event_t;
typedef enum {
PN_EVENT_NONE = 0,
PN_REACTOR_INIT,
PN_REACTOR_QUIESCED,
PN_REACTOR_FINAL,
PN_TIMER_TASK,
PN_CONNECTION_INIT,
PN_CONNECTION_BOUND,
PN_CONNECTION_UNBOUND,
PN_CONNECTION_LOCAL_OPEN,
PN_CONNECTION_REMOTE_OPEN,
PN_CONNECTION_LOCAL_CLOSE,
PN_CONNECTION_REMOTE_CLOSE,
PN_CONNECTION_FINAL,
PN_SESSION_INIT,
PN_SESSION_LOCAL_OPEN,
PN_SESSION_REMOTE_OPEN,
PN_SESSION_LOCAL_CLOSE,
PN_SESSION_REMOTE_CLOSE,
PN_SESSION_FINAL,
PN_LINK_INIT,
PN_LINK_LOCAL_OPEN,
PN_LINK_REMOTE_OPEN,
PN_LINK_LOCAL_CLOSE,
PN_LINK_REMOTE_CLOSE,
PN_LINK_LOCAL_DETACH,
PN_LINK_REMOTE_DETACH,
PN_LINK_FLOW,
PN_LINK_FINAL,
PN_DELIVERY,
PN_TRANSPORT,
PN_TRANSPORT_AUTHENTICATED,
PN_TRANSPORT_ERROR,
PN_TRANSPORT_HEAD_CLOSED,
PN_TRANSPORT_TAIL_CLOSED,
PN_TRANSPORT_CLOSED,
PN_SELECTABLE_INIT,
PN_SELECTABLE_UPDATED,
PN_SELECTABLE_READABLE,
PN_SELECTABLE_WRITABLE,
PN_SELECTABLE_ERROR,
PN_SELECTABLE_EXPIRED,
PN_SELECTABLE_FINAL,
PN_CONNECTION_WAKE,
PN_LISTENER_ACCEPT,
PN_LISTENER_CLOSE,
PN_PROACTOR_INTERRUPT,
PN_PROACTOR_TIMEOUT,
PN_PROACTOR_INACTIVE,
PN_LISTENER_OPEN,
PN_RAW_CONNECTION_CONNECTED,
PN_RAW_CONNECTION_CLOSED_READ,
PN_RAW_CONNECTION_CLOSED_WRITE,
PN_RAW_CONNECTION_DISCONNECTED,
PN_RAW_CONNECTION_NEED_READ_BUFFERS,
PN_RAW_CONNECTION_NEED_WRITE_BUFFERS,
PN_RAW_CONNECTION_READ,
PN_RAW_CONNECTION_WRITTEN,
PN_RAW_CONNECTION_WAKE,
PN_RAW_CONNECTION_DRAIN_BUFFERS
} pn_event_type_t;
PN_EXTERN const char *pn_event_type_name(pn_event_type_t type);
PN_EXTERN pn_collector_t *pn_collector(void);
PN_EXTERN void pn_collector_free(pn_collector_t *collector);
PN_EXTERN void pn_collector_release(pn_collector_t *collector);
PN_EXTERN void pn_collector_drain(pn_collector_t *collector);
PN_EXTERN pn_event_t *pn_collector_put(pn_collector_t *collector,
const pn_class_t *clazz, void *context,
pn_event_type_t type);
PN_EXTERN pn_event_t *pn_collector_peek(pn_collector_t *collector);
PN_EXTERN bool pn_collector_pop(pn_collector_t *collector);
PN_EXTERN pn_event_t *pn_collector_next(pn_collector_t *collector);
PN_EXTERN pn_event_t *pn_collector_prev(pn_collector_t *collector);
PN_EXTERN bool pn_collector_more(pn_collector_t *collector);
PN_EXTERN pn_event_type_t pn_event_type(pn_event_t *event);
PN_EXTERN const pn_class_t *pn_event_class(pn_event_t *event);
PN_EXTERN void *pn_event_context(pn_event_t *event);
PN_EXTERN pn_connection_t *pn_event_connection(pn_event_t *event);
PN_EXTERN pn_session_t *pn_event_session(pn_event_t *event);
PN_EXTERN pn_link_t *pn_event_link(pn_event_t *event);
PN_EXTERN pn_delivery_t *pn_event_delivery(pn_event_t *event);
PN_EXTERN pn_transport_t *pn_event_transport(pn_event_t *event);
PN_EXTERN pn_record_t *pn_event_attachments(pn_event_t *event);
PN_EXTERN struct pn_condition_t *pn_event_condition(pn_event_t *event);
#ifdef __cplusplus
}
#endif
#endif /* event.h */
pn_condition_t
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition condition.h:64
pn_connection_t
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition types.h:285
pn_delivery_t
struct pn_delivery_t pn_delivery_t
An AMQP Delivery object.
Definition types.h:405
pn_event_delivery
pn_delivery_t * pn_event_delivery(pn_event_t *event)
Get the delivery associated with an event.
pn_collector_release
void pn_collector_release(pn_collector_t *collector)
Release a collector.
pn_collector_put
pn_event_t * pn_collector_put(pn_collector_t *collector, const pn_class_t *clazz, void *context, pn_event_type_t type)
Place a new event on a collector.
pn_collector_free
void pn_collector_free(pn_collector_t *collector)
Free a collector.
pn_event_session
pn_session_t * pn_event_session(pn_event_t *event)
Get the session associated with an event.
pn_event_type_t
pn_event_type_t
An event type.
Definition event.h:80
pn_event_type_name
const char * pn_event_type_name(pn_event_type_t type)
Get a human readable name for an event type.
pn_collector_peek
pn_event_t * pn_collector_peek(pn_collector_t *collector)
Access the head event contained by a collector.
pn_collector_next
pn_event_t * pn_collector_next(pn_collector_t *collector)
Pop and return the head event, returns NULL if the collector is empty.
pn_collector_pop
bool pn_collector_pop(pn_collector_t *collector)
Remove the head event on a collector.
pn_event_link
pn_link_t * pn_event_link(pn_event_t *event)
Get the link associated with an event.
pn_collector
pn_collector_t * pn_collector(void)
Construct a collector.
pn_event_t
struct pn_event_t pn_event_t
Notification of a state change in the protocol engine.
Definition event.h:75
pn_collector_t
struct pn_collector_t pn_collector_t
An event collector.
Definition types.h:417
pn_event_class
const pn_class_t * pn_event_class(pn_event_t *event)
Get the class associated with the event context.
pn_event_connection
pn_connection_t * pn_event_connection(pn_event_t *event)
Get the connection associated with an event.
pn_collector_prev
pn_event_t * pn_collector_prev(pn_collector_t *collector)
Return the same pointer as the most recent call to pn_collector_next().
pn_collector_more
bool pn_collector_more(pn_collector_t *collector)
Check if there are more events after the current head event.
pn_event_attachments
pn_record_t * pn_event_attachments(pn_event_t *event)
Get any attachments associated with an event.
pn_event_condition
struct pn_condition_t * pn_event_condition(pn_event_t *event)
If the event context object has a condition and the condition is set return it, otherwise return NULL...
pn_event_type
pn_event_type_t pn_event_type(pn_event_t *event)
Get the type of an event.
pn_collector_drain
void pn_collector_drain(pn_collector_t *collector)
Drain a collector: remove and discard all events.
pn_event_context
void * pn_event_context(pn_event_t *event)
Get the context associated with an event.
pn_event_transport
pn_transport_t * pn_event_transport(pn_event_t *event)
Get the transport associated with an event.
PN_LISTENER_ACCEPT
@ PN_LISTENER_ACCEPT
Indicates the listener has an incoming connection, call pn_listener_accept2() to accept it.
Definition event.h:316
PN_SESSION_LOCAL_OPEN
@ PN_SESSION_LOCAL_OPEN
The local session endpoint has been opened.
Definition event.h:168
PN_LINK_REMOTE_CLOSE
@ PN_LINK_REMOTE_CLOSE
The remote endpoint has closed the link.
Definition event.h:223
PN_CONNECTION_REMOTE_CLOSE
@ PN_CONNECTION_REMOTE_CLOSE
The remote endpoint has closed the connection.
Definition event.h:149
PN_RAW_CONNECTION_DISCONNECTED
@ PN_RAW_CONNECTION_DISCONNECTED
The raw connection is disconnected.
Definition event.h:398
PN_TIMER_TASK
@ PN_TIMER_TASK
A timer event has occurred.
Definition event.h:106
PN_RAW_CONNECTION_CLOSED_WRITE
@ PN_RAW_CONNECTION_CLOSED_WRITE
The remote end of the raw connection closed the connection so that we can no longer write.
Definition event.h:386
PN_CONNECTION_INIT
@ PN_CONNECTION_INIT
The connection has been created.
Definition event.h:113
PN_TRANSPORT_CLOSED
@ PN_TRANSPORT_CLOSED
Indicates that the both the head and tail of the transport are closed.
Definition event.h:295
PN_EVENT_NONE
@ PN_EVENT_NONE
Defined as a programming convenience.
Definition event.h:85
PN_TRANSPORT_TAIL_CLOSED
@ PN_TRANSPORT_TAIL_CLOSED
Indicates that the tail of the transport has been closed.
Definition event.h:289
PN_RAW_CONNECTION_READ
@ PN_RAW_CONNECTION_READ
The raw connection read bytes: The bytes that were read are in one of the read buffers given to the r...
Definition event.h:440
PN_CONNECTION_WAKE
@ PN_CONNECTION_WAKE
pn_connection_wake() was called.
Definition event.h:309
PN_LINK_INIT
@ PN_LINK_INIT
The link has been created.
Definition event.h:199
PN_SESSION_REMOTE_CLOSE
@ PN_SESSION_REMOTE_CLOSE
The remote endpoint has closed the session.
Definition event.h:186
PN_LINK_LOCAL_CLOSE
@ PN_LINK_LOCAL_CLOSE
The local link endpoint has been closed.
Definition event.h:217
PN_RAW_CONNECTION_DRAIN_BUFFERS
@ PN_RAW_CONNECTION_DRAIN_BUFFERS
The raw connection is returning all the remaining buffers to the application.
Definition event.h:473
PN_LINK_REMOTE_OPEN
@ PN_LINK_REMOTE_OPEN
The remote endpoint has opened the link.
Definition event.h:211
PN_RAW_CONNECTION_WAKE
@ PN_RAW_CONNECTION_WAKE
The raw connection was woken by pn_raw_connection_wake.
Definition event.h:462
PN_PROACTOR_TIMEOUT
@ PN_PROACTOR_TIMEOUT
Timeout set by pn_proactor_set_timeout() time limit expired.
Definition event.h:334
PN_LINK_FLOW
@ PN_LINK_FLOW
The flow control state for a link has changed.
Definition event.h:241
PN_REACTOR_QUIESCED
@ PN_REACTOR_QUIESCED
A reactor has no more events to process.
Definition event.h:96
PN_LINK_REMOTE_DETACH
@ PN_LINK_REMOTE_DETACH
The remote endpoint has detached the link.
Definition event.h:235
PN_CONNECTION_LOCAL_OPEN
@ PN_CONNECTION_LOCAL_OPEN
The local connection endpoint has been closed.
Definition event.h:131
PN_SESSION_LOCAL_CLOSE
@ PN_SESSION_LOCAL_CLOSE
The local session endpoint has been closed.
Definition event.h:180
PN_LINK_LOCAL_OPEN
@ PN_LINK_LOCAL_OPEN
The local link endpoint has been opened.
Definition event.h:205
PN_CONNECTION_FINAL
@ PN_CONNECTION_FINAL
The connection has been freed and any outstanding processing has been completed.
Definition event.h:156
PN_LISTENER_OPEN
@ PN_LISTENER_OPEN
The listener is listening.
Definition event.h:350
PN_DELIVERY
@ PN_DELIVERY
A delivery has been created or updated.
Definition event.h:254
PN_RAW_CONNECTION_WRITTEN
@ PN_RAW_CONNECTION_WRITTEN
The raw connection has finished a write and the buffers that were used are no longer in use and can b...
Definition event.h:455
PN_TRANSPORT_ERROR
@ PN_TRANSPORT_ERROR
Indicates that a transport error has occurred.
Definition event.h:275
PN_RAW_CONNECTION_CLOSED_READ
@ PN_RAW_CONNECTION_CLOSED_READ
The remote end of the raw connection closed the connection so that we can no longer read.
Definition event.h:374
PN_LINK_LOCAL_DETACH
@ PN_LINK_LOCAL_DETACH
The local link endpoint has been detached.
Definition event.h:229
PN_RAW_CONNECTION_CONNECTED
@ PN_RAW_CONNECTION_CONNECTED
The raw connection connected.
Definition event.h:362
PN_PROACTOR_INACTIVE
@ PN_PROACTOR_INACTIVE
The proactor has become inactive: all listeners and connections were closed and the timeout (if set) ...
Definition event.h:344
PN_REACTOR_INIT
@ PN_REACTOR_INIT
A reactor has been started.
Definition event.h:90
PN_TRANSPORT_HEAD_CLOSED
@ PN_TRANSPORT_HEAD_CLOSED
Indicates that the "head" or writing end of the transport has been closed.
Definition event.h:282
PN_TRANSPORT_AUTHENTICATED
@ PN_TRANSPORT_AUTHENTICATED
The transport has authenticated.
Definition event.h:268
PN_CONNECTION_UNBOUND
@ PN_CONNECTION_UNBOUND
The connection has been unbound from its transport.
Definition event.h:125
PN_CONNECTION_LOCAL_CLOSE
@ PN_CONNECTION_LOCAL_CLOSE
The local connection endpoint has been closed.
Definition event.h:143
PN_REACTOR_FINAL
@ PN_REACTOR_FINAL
A reactor has been stopped.
Definition event.h:101
PN_RAW_CONNECTION_NEED_WRITE_BUFFERS
@ PN_RAW_CONNECTION_NEED_WRITE_BUFFERS
The raw connection might need more write buffers.
Definition event.h:425
PN_CONNECTION_REMOTE_OPEN
@ PN_CONNECTION_REMOTE_OPEN
The remote endpoint has opened the connection.
Definition event.h:137
PN_LISTENER_CLOSE
@ PN_LISTENER_CLOSE
Indicates the listener has closed.
Definition event.h:322
PN_TRANSPORT
@ PN_TRANSPORT
The transport has new data to read and/or write.
Definition event.h:260
PN_LINK_FINAL
@ PN_LINK_FINAL
The link has been freed and any outstanding processing has been completed.
Definition event.h:248
PN_RAW_CONNECTION_NEED_READ_BUFFERS
@ PN_RAW_CONNECTION_NEED_READ_BUFFERS
The raw connection might need more read buffers.
Definition event.h:411
PN_PROACTOR_INTERRUPT
@ PN_PROACTOR_INTERRUPT
Indicates pn_proactor_interrupt() was called to interrupt a proactor thread.
Definition event.h:328
PN_SESSION_INIT
@ PN_SESSION_INIT
The session has been created.
Definition event.h:162
PN_SESSION_FINAL
@ PN_SESSION_FINAL
The session has been freed and any outstanding processing has been completed.
Definition event.h:193
PN_CONNECTION_BOUND
@ PN_CONNECTION_BOUND
The connection has been bound to a transport.
Definition event.h:119
PN_SESSION_REMOTE_OPEN
@ PN_SESSION_REMOTE_OPEN
The remote endpoint has opened the session.
Definition event.h:174
pn_link_t
struct pn_link_t pn_link_t
An AMQP Link object.
Definition types.h:315
pn_session_t
struct pn_session_t pn_session_t
An AMQP Session object.
Definition types.h:296
pn_transport_t
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition types.h:435