proactor.h
Go to the documentation of this file.
#ifndef PROTON_PROACTOR_H
#define PROTON_PROACTOR_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/condition.h>
#include <proton/event.h>
#include <proton/import_export.h>
#include <proton/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PN_MAX_ADDR 1060
PNP_EXTERN int pn_proactor_addr(char *addr, size_t size, const char *host, const char *port);
PNP_EXTERN pn_proactor_t *pn_proactor(void);
PNP_EXTERN void pn_proactor_free(pn_proactor_t *proactor);
PNP_EXTERN void pn_proactor_connect2(pn_proactor_t *proactor, pn_connection_t *connection, pn_transport_t *transport, const char *addr);
PNP_EXTERN void pn_proactor_connect(pn_proactor_t *proactor, pn_connection_t *connection, const char *addr);
PNP_EXTERN void pn_proactor_listen(pn_proactor_t *proactor, pn_listener_t *listener, const char *addr, int backlog);
PNP_EXTERN void pn_proactor_disconnect(pn_proactor_t *proactor, pn_condition_t *condition);
PNP_EXTERN pn_event_batch_t *pn_proactor_wait(pn_proactor_t *proactor);
PNP_EXTERN pn_event_batch_t *pn_proactor_get(pn_proactor_t *proactor);
PNP_EXTERN void pn_proactor_done(pn_proactor_t *proactor, pn_event_batch_t *events);
PNP_EXTERN void pn_proactor_interrupt(pn_proactor_t *proactor);
PNP_EXTERN void pn_proactor_set_timeout(pn_proactor_t *proactor, pn_millis_t timeout);
PNP_EXTERN void pn_proactor_cancel_timeout(pn_proactor_t *proactor);
PNP_EXTERN void pn_proactor_release_connection(pn_connection_t *connection);
PNP_EXTERN void pn_connection_wake(pn_connection_t *connection);
PNP_EXTERN pn_proactor_t *pn_connection_proactor(pn_connection_t *connection);
PNP_EXTERN pn_proactor_t *pn_event_proactor(pn_event_t *event);
PNP_EXTERN pn_millis_t pn_proactor_now(void);
#ifdef __cplusplus
}
#endif
#endif /* proactor.h */
condition.h
An endpoint error state.
event.h
Protocol and transport events.
pn_millis_t
uint32_t pn_millis_t
A span of time in milliseconds.
Definition: types.h:145
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:281
pn_event_batch_t
struct pn_event_batch_t pn_event_batch_t
Unsettled API - A batch of events that must be handled in sequence.
Definition: event.h:547
pn_event_t
struct pn_event_t pn_event_t
Notification of a state change in the protocol engine.
Definition: event.h:75
pn_listener_t
struct pn_listener_t pn_listener_t
A listener for incoming connections.
Definition: types.h:420
pn_connection_wake
PNP_EXTERN void pn_connection_wake(pn_connection_t *connection)
Return a PN_CONNECTION_WAKE event for connection as soon as possible.
pn_proactor_release_connection
PNP_EXTERN void pn_proactor_release_connection(pn_connection_t *connection)
Release ownership of connection, disassociate it from its proactor.
pn_proactor_wait
PNP_EXTERN pn_event_batch_t * pn_proactor_wait(pn_proactor_t *proactor)
Wait until there are Proactor events to handle.
pn_connection_proactor
PNP_EXTERN pn_proactor_t * pn_connection_proactor(pn_connection_t *connection)
Return the proactor associated with a connection.
pn_proactor_free
PNP_EXTERN void pn_proactor_free(pn_proactor_t *proactor)
Free the proactor.
pn_proactor_get
PNP_EXTERN pn_event_batch_t * pn_proactor_get(pn_proactor_t *proactor)
Return Proactor events if any are available immediately.
pn_proactor_connect
PNP_EXTERN void pn_proactor_connect(pn_proactor_t *proactor, pn_connection_t *connection, const char *addr)
pn_proactor_interrupt
PNP_EXTERN void pn_proactor_interrupt(pn_proactor_t *proactor)
Return a PN_PROACTOR_INTERRUPT event as soon as possible.
pn_proactor_connect2
PNP_EXTERN void pn_proactor_connect2(pn_proactor_t *proactor, pn_connection_t *connection, pn_transport_t *transport, const char *addr)
Connect transport to addr and bind to connection.
pn_proactor_t
struct pn_proactor_t pn_proactor_t
A harness for multithreaded IO.
Definition: types.h:438
pn_proactor_cancel_timeout
PNP_EXTERN void pn_proactor_cancel_timeout(pn_proactor_t *proactor)
Cancel the pending timeout set by pn_proactor_set_timeout().
pn_proactor
PNP_EXTERN pn_proactor_t * pn_proactor(void)
Create a proactor.
pn_event_proactor
PNP_EXTERN pn_proactor_t * pn_event_proactor(pn_event_t *event)
Return the proactor associated with an event.
pn_proactor_disconnect
PNP_EXTERN void pn_proactor_disconnect(pn_proactor_t *proactor, pn_condition_t *condition)
Disconnect all connections and listeners belonging to the proactor.
pn_proactor_listen
PNP_EXTERN void pn_proactor_listen(pn_proactor_t *proactor, pn_listener_t *listener, const char *addr, int backlog)
Start listening for incoming connections.
pn_proactor_now
PNP_EXTERN pn_millis_t pn_proactor_now(void)
Get the real elapsed time since an arbitrary point in the past in milliseconds.
pn_proactor_set_timeout
PNP_EXTERN void pn_proactor_set_timeout(pn_proactor_t *proactor, pn_millis_t timeout)
Return a PN_PROACTOR_TIMEOUT after timeout milliseconds elapse.
pn_proactor_done
PNP_EXTERN void pn_proactor_done(pn_proactor_t *proactor, pn_event_batch_t *events)
Call when finished handling a batch of events.
pn_proactor_addr
PNP_EXTERN int pn_proactor_addr(char *addr, size_t size, const char *host, const char *port)
Format a host:port address string for pn_proactor_connect2() or pn_proactor_listen2()
pn_transport_t
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition: types.h:431
types.h
AMQP and API data types.