Qpid Proton C API  0.32.0
connection_driver.h
Go to the documentation of this file.
1 #ifndef PROTON_CONNECTION_DRIVER_H
2 #define PROTON_CONNECTION_DRIVER_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 
77 #include <proton/import_export.h>
78 #include <proton/event.h>
79 #include <proton/types.h>
80 
81 #include <stdarg.h>
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
90 typedef struct pn_connection_driver_t {
91  pn_connection_t *connection;
92  pn_transport_t *transport;
93  pn_collector_t *collector;
95 
113 
121 
127 
139 
149 
154 PN_EXTERN void pn_connection_driver_read_done(pn_connection_driver_t *, size_t n);
155 
160 
165 
175 
180 PN_EXTERN void pn_connection_driver_write_done(pn_connection_driver_t *, size_t n);
181 
186 
191 
196 
205 
210 
218 
228 PN_EXTERN void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...);
229 
233 PN_EXTERN void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list);
234 
239 #define PN_TRANSPORT_WRITE_CLOSED PN_TRANSPORT_HEAD_CLOSED
240 
245 #define PN_TRANSPORT_READ_CLOSED PN_TRANSPORT_TAIL_CLOSED
246 
250 PN_EXTERN void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg);
251 
255 PN_EXTERN void pn_connection_driver_logf(pn_connection_driver_t *d, const char *fmt, ...);
256 
260 PN_EXTERN void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap);
261 
274 
279 #ifdef __cplusplus
280 }
281 #endif
282 
283 #endif /* connection_driver.h */
void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg)
Deprecated - Use pn_transport_log().
AMQP and API data types.
int pn_connection_driver_bind(pn_connection_driver_t *d)
Force binding of the transport.
void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt,...)
Set transport error.
void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap)
Deprecated - Use pn_transport_vlogf().
pn_event_t * pn_connection_driver_next_event(pn_connection_driver_t *)
Get the next event to handle.
bool pn_connection_driver_has_event(pn_connection_driver_t *)
True if pn_connection_driver_next_event() will return a non-NULL event.
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition: types.h:435
pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *)
Get the read buffer.
A non-const byte buffer.
Definition: types.h:235
The elements needed to drive AMQP IO and events.
Definition: connection_driver.h:90
struct pn_collector_t pn_collector_t
An event collector.
Definition: types.h:417
bool pn_connection_driver_write_closed(pn_connection_driver_t *)
True if write side is closed.
pn_connection_t * pn_connection_driver_release_connection(pn_connection_driver_t *d)
Disassociate the driver&#39;s connection from its transport and collector and sets d->connection = NULL...
void pn_connection_driver_read_close(pn_connection_driver_t *)
Close the read side.
bool pn_connection_driver_read_closed(pn_connection_driver_t *)
True if read side is closed.
pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *)
Get the write buffer.
void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list)
Set transport error via a va_list, see pn_connection_driver_errorf()
int pn_connection_driver_init(pn_connection_driver_t *, pn_connection_t *, pn_transport_t *)
Set connection and transport to the provided values, or create a new pn_connection_t or pn_transport_...
pn_connection_driver_t ** pn_connection_driver_ptr(pn_connection_t *connection)
Associate a pn_connection_t with its pn_connection_driver_t.
void pn_connection_driver_close(pn_connection_driver_t *c)
Close both sides.
bool pn_connection_driver_finished(pn_connection_driver_t *)
Return true if the the driver is closed for reading and writing and there are no more events...
Protocol and transport events.
void pn_connection_driver_write_close(pn_connection_driver_t *)
Close the write side.
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:285
void pn_connection_driver_destroy(pn_connection_driver_t *)
Unbind, release and free the connection and transport.
void pn_connection_driver_write_done(pn_connection_driver_t *, size_t n)
Call when the first n bytes of pn_connection_driver_write_buffer() have been written to IO...
void pn_connection_driver_logf(pn_connection_driver_t *d, const char *fmt,...)
Deprecated - Use pn_transport_logf().
void pn_connection_driver_read_done(pn_connection_driver_t *, size_t n)
Process the first n bytes of data in pn_connection_driver_read_buffer() and reclaim the buffer space...
A const byte buffer.
Definition: types.h:216
struct pn_event_t pn_event_t
Notification of a state change in the protocol engine.
Definition: event.h:75