00001 #ifndef PROTON_SESSION_H 00002 #define PROTON_SESSION_H 1 00003 00004 /* 00005 * 00006 * Licensed to the Apache Software Foundation (ASF) under one 00007 * or more contributor license agreements. See the NOTICE file 00008 * distributed with this work for additional information 00009 * regarding copyright ownership. The ASF licenses this file 00010 * to you under the Apache License, Version 2.0 (the 00011 * "License"); you may not use this file except in compliance 00012 * with the License. You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, 00017 * software distributed under the License is distributed on an 00018 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00019 * KIND, either express or implied. See the License for the 00020 * specific language governing permissions and limitations 00021 * under the License. 00022 * 00023 */ 00024 00025 #include <proton/import_export.h> 00026 #include <proton/type_compat.h> 00027 #include <proton/types.h> 00028 #include <proton/object.h> 00029 #include <proton/error.h> 00030 #include <proton/condition.h> 00031 #include <stddef.h> 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00055 PN_EXTERN pn_session_t *pn_session(pn_connection_t *connection); 00056 00067 PN_EXTERN void pn_session_free(pn_session_t *session); 00068 00079 PN_EXTERN void *pn_session_get_context(pn_session_t *session); 00080 00090 PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context); 00091 00098 PN_EXTERN pn_record_t *pn_session_attachments(pn_session_t *session); 00099 00106 PN_EXTERN pn_state_t pn_session_state(pn_session_t *session); 00107 00124 /* PN_DEPRECATED("Use pn_session_condition") */ 00125 PN_EXTERN pn_error_t *pn_session_error(pn_session_t *session); 00126 00143 PN_EXTERN pn_condition_t *pn_session_condition(pn_session_t *session); 00144 00159 PN_EXTERN pn_condition_t *pn_session_remote_condition(pn_session_t *session); 00160 00170 PN_EXTERN pn_connection_t *pn_session_connection(pn_session_t *session); 00171 00180 PN_EXTERN void pn_session_open(pn_session_t *session); 00181 00192 PN_EXTERN void pn_session_close(pn_session_t *session); 00193 00203 PN_EXTERN size_t pn_session_get_incoming_capacity(pn_session_t *session); 00204 00222 PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *session, size_t capacity); 00223 00230 PN_EXTERN size_t pn_session_get_outgoing_window(pn_session_t *session); 00231 00238 PN_EXTERN void pn_session_set_outgoing_window(pn_session_t *session, size_t window); 00239 00246 PN_EXTERN size_t pn_session_outgoing_bytes(pn_session_t *session); 00247 00254 PN_EXTERN size_t pn_session_incoming_bytes(pn_session_t *session); 00255 00272 PN_EXTERN pn_session_t *pn_session_head(pn_connection_t *connection, pn_state_t state); 00273 00288 PN_EXTERN pn_session_t *pn_session_next(pn_session_t *session, pn_state_t state); 00289 00294 #ifdef __cplusplus 00295 } 00296 #endif 00297 00298 #endif /* session.h */