/usr/include/proton/session.h is in libqpid-proton2-dev 0.10-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | #ifndef PROTON_SESSION_H
#define PROTON_SESSION_H 1
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include <proton/import_export.h>
#include <proton/type_compat.h>
#include <proton/types.h>
#include <proton/object.h>
#include <proton/error.h>
#include <proton/condition.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @file
* Session API for the proton Engine.
*
* @defgroup session Session
* @ingroup engine
* @{
*/
/**
* Factory for creating a new session on a given connection object.
*
* Creates a new session object and adds it to the set of sessions
* maintained by the connection object.
*
* @param[in] connection the connection object
* @return a pointer to the new session
*/
PN_EXTERN pn_session_t *pn_session(pn_connection_t *connection);
/**
* Free a session object.
*
* When a session is freed it will no longer be retained by the
* connection once any internal references to the session are no
* longer needed. Freeing a session will free all links on that
* session and settle any deliveries on those links.
*
* @param[in] session a session object to free (or NULL)
*/
PN_EXTERN void pn_session_free(pn_session_t *session);
/**
* @deprecated
* Get the application context that is associated with a session
* object.
*
* The application context for a session may be set using
* ::pn_session_set_context.
*
* @param[in] session the session whose context is to be returned.
* @return the application context for the session object
*/
PN_EXTERN void *pn_session_get_context(pn_session_t *session);
/**
* @deprecated
* Set a new application context for a session object.
*
* The application context for a session object may be retrieved
* using ::pn_session_get_context.
*
* @param[in] session the session object
* @param[in] context the application context
*/
PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context);
/**
* Get the attachments that are associated with a session object.
*
* @param[in] session the session whose attachments are to be returned.
* @return the attachments for the session object
*/
PN_EXTERN pn_record_t *pn_session_attachments(pn_session_t *session);
/**
* Get the endpoint state flags for a session.
*
* @param[in] session the session
* @return the session's state flags
*/
PN_EXTERN pn_state_t pn_session_state(pn_session_t *session);
/**
* Get additional error information associated with the session.
*
* Whenever a session operation fails (i.e. returns an error code),
* additional error details can be obtained using this function. The
* error object that is returned may also be used to clear the error
* condition.
*
* The pointer returned by this operation is valid until the
* session object is freed.
*
* @param[in] session the sesion object
* @return the session's error object
*/
PN_EXTERN pn_error_t *pn_session_error(pn_session_t *session);
/**
* Get the local condition associated with the session endpoint.
*
* The ::pn_condition_t object retrieved may be modified prior to
* closing the session in order to indicate a particular condition
* exists when the session closes. This is normally used to
* communicate error conditions to the remote peer, however it may
* also be used in non error cases. See ::pn_condition_t for more
* details.
*
* The pointer returned by this operation is valid until the session
* object is freed.
*
* @param[in] session the session object
* @return the session's local condition object
*/
PN_EXTERN pn_condition_t *pn_session_condition(pn_session_t *session);
/**
* Get the remote condition associated with the session endpoint.
*
* The ::pn_condition_t object retrieved may be examined in order to
* determine whether the remote peer was indicating some sort of
* exceptional condition when the remote session endpoint was
* closed. The ::pn_condition_t object returned may not be modified.
*
* The pointer returned by this operation is valid until the
* session object is freed.
*
* @param[in] session the session object
* @return the session's remote condition object
*/
PN_EXTERN pn_condition_t *pn_session_remote_condition(pn_session_t *session);
/**
* Get the parent connection for a session object.
*
* This operation retrieves the parent pn_connection_t object that
* contains the given pn_session_t object.
*
* @param[in] session the session object
* @return the parent connection object
*/
PN_EXTERN pn_connection_t *pn_session_connection(pn_session_t *session);
/**
* Open a session.
*
* Once this operation has completed, the PN_LOCAL_ACTIVE state flag
* will be set.
*
* @param[in] session a session object
*/
PN_EXTERN void pn_session_open(pn_session_t *session);
/**
* Close a session.
*
* Once this operation has completed, the PN_LOCAL_CLOSED state flag
* will be set. This may be called without calling
* ::pn_session_open, in this case it is equivalent to calling
* ::pn_session_open followed by ::pn_session_close.
*
* @param[in] session a session object
*/
PN_EXTERN void pn_session_close(pn_session_t *session);
/**
* Get the incoming capacity of the session measured in bytes.
*
* The incoming capacity of a session determines how much incoming
* message data the session will buffer. Note that if this value is
* less than the negotiated frame size of the transport, it will be
* rounded up to one full frame.
*
* @param[in] session the session object
* @return the incoming capacity of the session in bytes
*/
PN_EXTERN size_t pn_session_get_incoming_capacity(pn_session_t *session);
/**
* Set the incoming capacity for a session object.
*
* The incoming capacity of a session determines how much incoming
* message data the session will buffer. Note that if this value is
* less than the negotiated frame size of the transport, it will be
* rounded up to one full frame.
*
* @param[in] session the session object
* @param[in] capacity the incoming capacity for the session
*/
PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *session, size_t capacity);
/**
* Get the outgoing window for a session object.
*
* @param[in] session the session object
* @return the outgoing window for the session
*/
PN_EXTERN size_t pn_session_get_outgoing_window(pn_session_t *session);
/**
* Set the outgoing window for a session object.
*
* @param[in] session the session object
* @param[in] window the outgoing window for the session
*/
PN_EXTERN void pn_session_set_outgoing_window(pn_session_t *session, size_t window);
/**
* Get the number of outgoing bytes currently buffered by a session.
*
* @param[in] session a session object
* @return the number of outgoing bytes currently buffered
*/
PN_EXTERN size_t pn_session_outgoing_bytes(pn_session_t *session);
/**
* Get the number of incoming bytes currently buffered by a session.
*
* @param[in] session a session object
* @return the number of incoming bytes currently buffered
*/
PN_EXTERN size_t pn_session_incoming_bytes(pn_session_t *session);
/**
* Retrieve the first session from a given connection that matches the
* specified state mask.
*
* Examines the state of each session owned by the connection, and
* returns the first session that matches the given state mask. If
* state contains both local and remote flags, then an exact match
* against those flags is performed. If state contains only local or
* only remote flags, then a match occurs if any of the local or
* remote flags are set respectively.
*
* @param[in] connection to be searched for matching sessions
* @param[in] state mask to match
* @return the first session owned by the connection that matches the
* mask, else NULL if no sessions match
*/
PN_EXTERN pn_session_t *pn_session_head(pn_connection_t *connection, pn_state_t state);
/**
* Retrieve the next session from a given connection that matches the
* specified state mask.
*
* When used with ::pn_session_head, application can access all
* sessions on the connection that match the given state. See
* ::pn_session_head for description of match behavior.
*
* @param[in] session the previous session obtained from
* ::pn_session_head or ::pn_session_next
* @param[in] state mask to match.
* @return the next session owned by the connection that matches the
* mask, else NULL if no sessions match
*/
PN_EXTERN pn_session_t *pn_session_next(pn_session_t *session, pn_state_t state);
/** @}
*/
#ifdef __cplusplus
}
#endif
#endif /* session.h */
|