Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
proactor.h
Go to the documentation of this file.
1 #ifndef PROTON_PROACTOR_H
2 #define PROTON_PROACTOR_H 1
3 
4 /*
5  * Licensed to the Apache Software Foundation (ASF) under one
6  * or more contributor license agreements. See the NOTICE file
7  * distributed with this work for additional information
8  * regarding copyright ownership. The ASF licenses this file
9  * to you under the Apache License, Version 2.0 (the
10  * "License"); you may not use this file except in compliance
11  * with the License. You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing,
16  * software distributed under the License is distributed on an
17  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  * KIND, either express or implied. See the License for the
19  * specific language governing permissions and limitations
20  * under the License.
21  */
22 
23 #include <proton/types.h>
24 #include <proton/import_export.h>
25 #include <proton/listener.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef struct pn_condition_t pn_condition_t;
64 
69 
74 void pn_proactor_free(pn_proactor_t *proactor);
75 
89 int pn_proactor_connect(pn_proactor_t *proactor, pn_connection_t *connection,
90  const char *host, const char *port);
91 
106 int pn_proactor_listen(pn_proactor_t *proactor, pn_listener_t *listener,
107  const char *host, const char *port, int backlog);
108 
127 
137 void pn_proactor_done(pn_proactor_t *proactor, pn_event_batch_t *events);
138 
151 void pn_proactor_interrupt(pn_proactor_t *proactor);
152 
163 void pn_proactor_set_timeout(pn_proactor_t *proactor, pn_millis_t timeout);
164 
175 void pn_connection_wake(pn_connection_t *connection);
176 
181 
186 
191 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* proactor.h */
void pn_connection_wake(pn_connection_t *connection)
Cause a PN_CONNECTION_WAKE event to be returned by the proactor, even if there are no IO events pendi...
pn_event_batch_t * pn_proactor_wait(pn_proactor_t *proactor)
Wait for events to handle.
uint32_t pn_millis_t
A span of time in milliseconds.
Definition: types.h:139
AMQP and API data types.
struct pn_listener_t pn_listener_t
A listener accepts connections.
Definition: listener.h:51
Experimental - A listener for incoming connections for the Proactor.
pn_proactor_t * pn_connection_proactor(pn_connection_t *connection)
Return the proactor associated with a connection or NULL.
struct pn_event_batch_t pn_event_batch_t
Experimental - A batch of events to handle.
Definition: event.h:544
struct pn_proactor_t pn_proactor_t
The proactor, see pn_proactor()
Definition: proactor.h:63
pn_proactor_t * pn_proactor(void)
Create a proactor.
int pn_proactor_connect(pn_proactor_t *proactor, pn_connection_t *connection, const char *host, const char *port)
Connect connection to host/port.
void pn_proactor_free(pn_proactor_t *proactor)
Free the proactor.
int pn_proactor_listen(pn_proactor_t *proactor, pn_listener_t *listener, const char *host, const char *port, int backlog)
Start listening with listener.
void pn_proactor_set_timeout(pn_proactor_t *proactor, pn_millis_t timeout)
Cause PN_PROACTOR_TIMEOUT to be returned to a thread calling wait() after timeout milliseconds...
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:275
pn_listener_t * pn_event_listener(pn_event_t *event)
Return the listener associated with an event or NULL.
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition: condition.h:64
void pn_proactor_interrupt(pn_proactor_t *proactor)
Cause PN_PROACTOR_INTERRUPT to be returned to exactly one call of pn_proactor_wait().
struct pn_event_t pn_event_t
Notification of a state change in the protocol engine.
Definition: event.h:75
pn_proactor_t * pn_event_proactor(pn_event_t *event)
Return the proactor associated with an event or NULL.
void pn_proactor_done(pn_proactor_t *proactor, pn_event_batch_t *events)
Call when done handling a batch of events.