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_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 /* connection_driver.h */

Generated on 1 Jun 2020 for Qpid Proton C by  doxygen 1.6.1