00001 #ifndef PROTON_CONNECTION_DRIVER_H
00002 #define PROTON_CONNECTION_DRIVER_H 1
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00077 #include <proton/import_export.h>
00078 #include <proton/event.h>
00079 #include <proton/types.h>
00080
00081 #include <stdarg.h>
00082
00083 #ifdef __cplusplus
00084 extern "C" {
00085 #endif
00086
00090 typedef struct pn_connection_driver_t {
00091 pn_connection_t *connection;
00092 pn_transport_t *transport;
00093 pn_collector_t *collector;
00094 } pn_connection_driver_t;
00095
00112 PN_EXTERN int pn_connection_driver_init(pn_connection_driver_t*, pn_connection_t*, pn_transport_t*);
00113
00120 PN_EXTERN int pn_connection_driver_bind(pn_connection_driver_t *d);
00121
00126 PN_EXTERN void pn_connection_driver_destroy(pn_connection_driver_t *);
00127
00138 PN_EXTERN pn_connection_t *pn_connection_driver_release_connection(pn_connection_driver_t *d);
00139
00148 PN_EXTERN pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *);
00149
00154 PN_EXTERN void pn_connection_driver_read_done(pn_connection_driver_t *, size_t n);
00155
00159 PN_EXTERN void pn_connection_driver_read_close(pn_connection_driver_t *);
00160
00164 PN_EXTERN bool pn_connection_driver_read_closed(pn_connection_driver_t *);
00165
00174 PN_EXTERN pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *);
00175
00180 PN_EXTERN void pn_connection_driver_write_done(pn_connection_driver_t *, size_t n);
00181
00185 PN_EXTERN void pn_connection_driver_write_close(pn_connection_driver_t *);
00186
00190 PN_EXTERN bool pn_connection_driver_write_closed(pn_connection_driver_t *);
00191
00195 PN_EXTERN void pn_connection_driver_close(pn_connection_driver_t * c);
00196
00204 PN_EXTERN pn_event_t* pn_connection_driver_next_event(pn_connection_driver_t *);
00205
00209 PN_EXTERN bool pn_connection_driver_has_event(pn_connection_driver_t *);
00210
00217 PN_EXTERN bool pn_connection_driver_finished(pn_connection_driver_t *);
00218
00228 PN_EXTERN void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...);
00229
00233 PN_EXTERN void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list);
00234
00239 #define PN_TRANSPORT_WRITE_CLOSED PN_TRANSPORT_HEAD_CLOSED
00240
00245 #define PN_TRANSPORT_READ_CLOSED PN_TRANSPORT_TAIL_CLOSED
00246
00250 PN_EXTERN void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg);
00251
00255 PN_EXTERN void pn_connection_driver_logf(pn_connection_driver_t *d, const char *fmt, ...);
00256
00260 PN_EXTERN void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap);
00261
00273 PN_EXTERN pn_connection_driver_t **pn_connection_driver_ptr(pn_connection_t *connection);
00274
00279 #ifdef __cplusplus
00280 }
00281 #endif
00282
00283 #endif