proton/connection_driver.h

Go to the documentation of this file.
00001 #ifndef PROTON_CONNECTION_DRIVER_H
00002 #define PROTON_CONNECTION_DRIVER_H 1
00003 
00004 /*
00005  * Licensed to the Apache Software Foundation (ASF) under one
00006  * or more contributor license agreements.  See the NOTICE file
00007  * distributed with this work for additional information
00008  * regarding copyright ownership.  The ASF licenses this file
00009  * to you under the Apache License, Version 2.0 (the
00010  * "License"); you may not use this file except in compliance
00011  * with the License.  You may obtain a copy of the License at
00012  *
00013  *   http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing,
00016  * software distributed under the License is distributed on an
00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018  * KIND, either express or implied.  See the License for the
00019  * specific language governing permissions and limitations
00020  * under the License.
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_event_batch_t batch;
00095 } pn_connection_driver_t;
00096 
00113 PN_EXTERN int pn_connection_driver_init(pn_connection_driver_t*, pn_connection_t*, pn_transport_t*);
00114 
00121 PN_EXTERN int pn_connection_driver_bind(pn_connection_driver_t *d);
00122 
00127 PN_EXTERN void pn_connection_driver_destroy(pn_connection_driver_t *);
00128 
00139 PN_EXTERN pn_connection_t *pn_connection_driver_release_connection(pn_connection_driver_t *d);
00140 
00149 PN_EXTERN pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *);
00150 
00155 PN_EXTERN void pn_connection_driver_read_done(pn_connection_driver_t *, size_t n);
00156 
00160 PN_EXTERN void pn_connection_driver_read_close(pn_connection_driver_t *);
00161 
00165 PN_EXTERN bool pn_connection_driver_read_closed(pn_connection_driver_t *);
00166 
00175  PN_EXTERN pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *);
00176 
00181 PN_EXTERN void pn_connection_driver_write_done(pn_connection_driver_t *, size_t n);
00182 
00186 PN_EXTERN void pn_connection_driver_write_close(pn_connection_driver_t *);
00187 
00191 PN_EXTERN bool pn_connection_driver_write_closed(pn_connection_driver_t *);
00192 
00196 PN_EXTERN void pn_connection_driver_close(pn_connection_driver_t * c);
00197 
00205 PN_EXTERN pn_event_t* pn_connection_driver_next_event(pn_connection_driver_t *);
00206 
00210 PN_EXTERN bool pn_connection_driver_has_event(pn_connection_driver_t *);
00211 
00218 PN_EXTERN bool pn_connection_driver_finished(pn_connection_driver_t *);
00219 
00229 PN_EXTERN void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...);
00230 
00234 PN_EXTERN void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list);
00235 
00240 PN_EXTERN pn_connection_driver_t* pn_event_batch_connection_driver(pn_event_batch_t *batch);
00241 
00246 #define PN_TRANSPORT_WRITE_CLOSED PN_TRANSPORT_HEAD_CLOSED
00247 
00252 #define PN_TRANSPORT_READ_CLOSED PN_TRANSPORT_TAIL_CLOSED
00253 
00257 PN_EXTERN void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg);
00258 
00262 PN_EXTERN void pn_connection_driver_logf(pn_connection_driver_t *d, const char *fmt, ...);
00263 
00267 PN_EXTERN void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap);
00268 
00280 PN_EXTERN pn_connection_driver_t **pn_connection_driver_ptr(pn_connection_t *connection);
00281 
00286 #ifdef __cplusplus
00287 }
00288 #endif
00289 
00290 #endif /* connection_driver.h */

Generated on 29 Mar 2018 for Qpid Proton C by  doxygen 1.6.1