Qpid Proton C API  0.37.0
messenger.h File Reference

Deprecated - Use the Proactor API or Qpid Proton C++. More...

#include <proton/import_export.h>
#include <proton/message.h>
#include <proton/selectable.h>
#include <proton/link.h>
#include <proton/transport.h>
#include <proton/ssl.h>

Go to the source code of this file.

Macros

#define PN_CUMULATIVE
 Indicates that an accept or reject should operate cumulatively.
 
#define PN_FLAGS_CHECK_ROUTES
 Messenger flag to indicate that a call \ to pn_messenger_start should check that \ any defined routes are valid.
 
#define PN_FLAGS_ALLOW_INSECURE_MECHS
 Messenger flag to indicate that the PLAIN \ mechanism is allowed on an unencrypted \ connection.
 

Typedefs

typedef struct pn_messenger_t pn_messenger_t
 A pn_messenger_t provides a high level interface for sending and receiving messages (See pn_message_t). More...
 
typedef struct pn_subscription_t pn_subscription_t
 A subscription is a request for incoming messages.
 
typedef int64_t pn_tracker_t
 Trackers provide a lightweight handle used to track the status of incoming and outgoing deliveries.
 

Enumerations

enum  pn_status_t {
  PN_STATUS_UNKNOWN , PN_STATUS_PENDING , PN_STATUS_ACCEPTED , PN_STATUS_REJECTED ,
  PN_STATUS_RELEASED , PN_STATUS_MODIFIED , PN_STATUS_ABORTED , PN_STATUS_SETTLED
}
 Describes all the possible states for a message associated with a given tracker. More...
 

Functions

pn_messenger_tpn_messenger (const char *name)
 Construct a new pn_messenger_t with the given name. More...
 
const char * pn_messenger_name (pn_messenger_t *messenger)
 Get the name of a messenger. More...
 
int pn_messenger_set_certificate (pn_messenger_t *messenger, const char *certificate)
 Sets the path that will be used to get the certificate that will be used to identify this messenger to its peers. More...
 
const char * pn_messenger_get_certificate (pn_messenger_t *messenger)
 Get the certificate path. More...
 
int pn_messenger_set_private_key (pn_messenger_t *messenger, const char *private_key)
 Set path to the private key that was used to sign the certificate. More...
 
const char * pn_messenger_get_private_key (pn_messenger_t *messenger)
 Gets the private key file for a messenger. More...
 
int pn_messenger_set_password (pn_messenger_t *messenger, const char *password)
 Sets the private key password for a messenger. More...
 
const char * pn_messenger_get_password (pn_messenger_t *messenger)
 Gets the private key file password for a messenger. More...
 
int pn_messenger_set_trusted_certificates (pn_messenger_t *messenger, const char *cert_db)
 Sets the trusted certificates database for a messenger. More...
 
const char * pn_messenger_get_trusted_certificates (pn_messenger_t *messenger)
 Gets the trusted certificates database for a messenger. More...
 
int pn_messenger_set_timeout (pn_messenger_t *messenger, int timeout)
 Set the default timeout for a messenger. More...
 
int pn_messenger_get_timeout (pn_messenger_t *messenger)
 Gets the timeout for a messenger object. More...
 
bool pn_messenger_is_blocking (pn_messenger_t *messenger)
 Check if a messenger is in blocking mode. More...
 
int pn_messenger_set_blocking (pn_messenger_t *messenger, bool blocking)
 Enable or disable blocking behavior for a messenger during calls to pn_messenger_send and pn_messenger_recv. More...
 
bool pn_messenger_is_passive (pn_messenger_t *messenger)
 Check if a messenger is in passive mode. More...
 
int pn_messenger_set_passive (pn_messenger_t *messenger, bool passive)
 Set the passive mode for a messenger. More...
 
void pn_messenger_free (pn_messenger_t *messenger)
 Frees a Messenger. More...
 
int pn_messenger_errno (pn_messenger_t *messenger)
 Get the code for a messenger's most recent error. More...
 
pn_error_tpn_messenger_error (pn_messenger_t *messenger)
 Get a messenger's error object. More...
 
int pn_messenger_get_outgoing_window (pn_messenger_t *messenger)
 Get the size of a messenger's outgoing window. More...
 
int pn_messenger_set_outgoing_window (pn_messenger_t *messenger, int window)
 Set the size of a messenger's outgoing window. More...
 
int pn_messenger_get_incoming_window (pn_messenger_t *messenger)
 Get the size of a messenger's incoming window. More...
 
int pn_messenger_set_incoming_window (pn_messenger_t *messenger, int window)
 Set the size of a messenger's incoming window. More...
 
int pn_messenger_start (pn_messenger_t *messenger)
 Currently a no-op placeholder. More...
 
int pn_messenger_stop (pn_messenger_t *messenger)
 Stops a messenger. More...
 
bool pn_messenger_stopped (pn_messenger_t *messenger)
 Returns true if a messenger is in the stopped state. More...
 
pn_subscription_tpn_messenger_subscribe (pn_messenger_t *messenger, const char *source)
 Subscribes a messenger to messages from the specified source. More...
 
pn_subscription_tpn_messenger_subscribe_ttl (pn_messenger_t *messenger, const char *source, pn_seconds_t timeout)
 Subscribes a messenger to messages from the specified source with the given timeout for the subscription's lifetime. More...
 
pn_link_tpn_messenger_get_link (pn_messenger_t *messenger, const char *address, bool sender)
 Get a link based on link name and whether the link is a sender or receiver. More...
 
void * pn_subscription_get_context (pn_subscription_t *sub)
 Get a subscription's application context. More...
 
void pn_subscription_set_context (pn_subscription_t *sub, void *context)
 Set an application context for a subscription. More...
 
const char * pn_subscription_address (pn_subscription_t *sub)
 Get the source address of a subscription. More...
 
int pn_messenger_put (pn_messenger_t *messenger, pn_message_t *msg)
 Puts a message onto the messenger's outgoing queue. More...
 
pn_status_t pn_messenger_status (pn_messenger_t *messenger, pn_tracker_t tracker)
 Track the status of a delivery. More...
 
pn_delivery_tpn_messenger_delivery (pn_messenger_t *messenger, pn_tracker_t tracker)
 Get delivery information about a delivery. More...
 
bool pn_messenger_buffered (pn_messenger_t *messenger, pn_tracker_t tracker)
 Check if the delivery associated with a given tracker is still waiting to be sent. More...
 
int pn_messenger_settle (pn_messenger_t *messenger, pn_tracker_t tracker, int flags)
 Frees a Messenger from tracking the status associated with a given tracker. More...
 
pn_tracker_t pn_messenger_outgoing_tracker (pn_messenger_t *messenger)
 Get a tracker for the outgoing message most recently given to pn_messenger_put. More...
 
int pn_messenger_work (pn_messenger_t *messenger, int timeout)
 Sends or receives any outstanding messages queued for a messenger. More...
 
int pn_messenger_interrupt (pn_messenger_t *messenger)
 Interrupt a messenger object that may be blocking in another thread. More...
 
int pn_messenger_send (pn_messenger_t *messenger, int n)
 Send messages from a messenger's outgoing queue. More...
 
int pn_messenger_recv (pn_messenger_t *messenger, int limit)
 Retrieve messages into a messenger's incoming queue. More...
 
int pn_messenger_receiving (pn_messenger_t *messenger)
 Get the capacity of the incoming message queue of a messenger. More...
 
int pn_messenger_get (pn_messenger_t *messenger, pn_message_t *message)
 Get the next message from the head of a messenger's incoming queue. More...
 
pn_tracker_t pn_messenger_incoming_tracker (pn_messenger_t *messenger)
 Get a tracker for the message most recently retrieved by pn_messenger_get(). More...
 
pn_subscription_tpn_messenger_incoming_subscription (pn_messenger_t *messenger)
 Get the subscription of the message most recently retrieved by pn_messenger_get(). More...
 
int pn_messenger_accept (pn_messenger_t *messenger, pn_tracker_t tracker, int flags)
 Signal successful processing of message(s). More...
 
int pn_messenger_reject (pn_messenger_t *messenger, pn_tracker_t tracker, int flags)
 Signal unsuccessful processing of message(s). More...
 
pn_link_tpn_messenger_tracker_link (pn_messenger_t *messenger, pn_tracker_t tracker)
 Get link for the message referenced by the given tracker. More...
 
int pn_messenger_outgoing (pn_messenger_t *messenger)
 Get the number of messages in the outgoing message queue of a messenger. More...
 
int pn_messenger_incoming (pn_messenger_t *messenger)
 Get the number of messages in the incoming message queue of a messenger. More...
 
int pn_messenger_route (pn_messenger_t *messenger, const char *pattern, const char *address)
 Adds a routing rule to a Messenger's internal routing table. More...
 
int pn_messenger_rewrite (pn_messenger_t *messenger, const char *pattern, const char *address)
 Rewrite message addresses prior to transmission. More...
 
pn_selectable_t * pn_messenger_selectable (pn_messenger_t *messenger)
 Extract selectables from a passive messenger. More...
 
pn_timestamp_t pn_messenger_deadline (pn_messenger_t *messenger)
 Get the nearest deadline for selectables associated with a messenger. More...
 
int pn_messenger_set_flags (pn_messenger_t *messenger, const int flags)
 Sets control flags to enable additional function for the Messenger. More...
 
int pn_messenger_get_flags (pn_messenger_t *messenger)
 Gets the flags for a Messenger. More...
 
int pn_messenger_set_snd_settle_mode (pn_messenger_t *messenger, const pn_snd_settle_mode_t mode)
 Set the local sender settle mode for the underlying link. More...
 
int pn_messenger_set_rcv_settle_mode (pn_messenger_t *messenger, const pn_rcv_settle_mode_t mode)
 Set the local receiver settle mode for the underlying link. More...
 
void pn_messenger_set_tracer (pn_messenger_t *messenger, pn_tracer_t tracer)
 Set the tracer associated with a messenger. More...
 
pn_millis_t pn_messenger_get_remote_idle_timeout (pn_messenger_t *messenger, const char *address)
 Gets the remote idle timeout for the specified remote service address. More...
 
int pn_messenger_set_ssl_peer_authentication_mode (pn_messenger_t *messenger, const pn_ssl_verify_mode_t mode)
 Sets the SSL peer authentication mode required when a trust certificate is used. More...
 

Detailed Description

Deprecated - Use the Proactor API or Qpid Proton C++.