Qpid Proton C API  0.18.0
session.h
Go to the documentation of this file.
1 #ifndef PROTON_SESSION_H
2 #define PROTON_SESSION_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #include <proton/type_compat.h>
27 #include <proton/types.h>
28 #include <proton/object.h>
29 #include <proton/error.h>
30 #include <proton/condition.h>
31 #include <stddef.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
55 PN_EXTERN pn_session_t *pn_session(pn_connection_t *connection);
56 
67 PN_EXTERN void pn_session_free(pn_session_t *session);
68 
81 PN_EXTERN void *pn_session_get_context(pn_session_t *session);
82 
94 PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context);
95 
102 PN_EXTERN pn_record_t *pn_session_attachments(pn_session_t *session);
103 
110 PN_EXTERN pn_state_t pn_session_state(pn_session_t *session);
111 
128 PN_EXTERN pn_error_t *pn_session_error(pn_session_t *session);
129 
147 
163 
174 
183 PN_EXTERN void pn_session_open(pn_session_t *session);
184 
195 PN_EXTERN void pn_session_close(pn_session_t *session);
196 
208 PN_EXTERN size_t pn_session_get_incoming_capacity(pn_session_t *session);
209 
221 PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *session, size_t capacity);
222 
229 PN_EXTERN size_t pn_session_get_outgoing_window(pn_session_t *session);
230 
237 PN_EXTERN void pn_session_set_outgoing_window(pn_session_t *session, size_t window);
238 
245 PN_EXTERN size_t pn_session_outgoing_bytes(pn_session_t *session);
246 
253 PN_EXTERN size_t pn_session_incoming_bytes(pn_session_t *session);
254 
271 PN_EXTERN pn_session_t *pn_session_head(pn_connection_t *connection, pn_state_t state);
272 
287 PN_EXTERN pn_session_t *pn_session_next(pn_session_t *session, pn_state_t state);
288 
293 #ifdef __cplusplus
294 }
295 #endif
296 
297 #endif /* session.h */
AMQP and API data types.
pn_error_t * pn_session_error(pn_session_t *session)
Deprecated
void pn_session_set_incoming_capacity(pn_session_t *session, size_t capacity)
Set the incoming capacity for a session object.
void pn_session_free(pn_session_t *session)
Free a session object.
size_t pn_session_outgoing_bytes(pn_session_t *session)
Get the number of outgoing bytes currently buffered by a session.
pn_condition_t * pn_session_remote_condition(pn_session_t *session)
Get the remote condition associated with the session endpoint.
void pn_session_set_outgoing_window(pn_session_t *session, size_t window)
Set the outgoing window for a session object.
void * pn_session_get_context(pn_session_t *session)
Deprecated - Use pn_session_attachments().
struct pn_error_t pn_error_t
An int error code and some string text to describe the error.
Definition: error.h:44
struct pn_session_t pn_session_t
An AMQP Session object.
Definition: types.h:292
A Proton API error.
pn_connection_t * pn_session_connection(pn_session_t *session)
Get the parent connection for a session object.
pn_record_t * pn_session_attachments(pn_session_t *session)
Get the attachments that are associated with a session object.
An endpoint error state.
size_t pn_session_incoming_bytes(pn_session_t *session)
Get the number of incoming bytes currently buffered by a session.
size_t pn_session_get_outgoing_window(pn_session_t *session)
Get the outgoing window for a session object.
pn_state_t pn_session_state(pn_session_t *session)
Get the endpoint state flags for a session.
pn_session_t * pn_session_head(pn_connection_t *connection, pn_state_t state)
Retrieve the first session from a given connection that matches the specified state mask...
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:281
size_t pn_session_get_incoming_capacity(pn_session_t *session)
Get the incoming capacity of the session measured in bytes.
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition: condition.h:64
void pn_session_open(pn_session_t *session)
Open a session.
void pn_session_close(pn_session_t *session)
Close a session.
int pn_state_t
Holds the state flags for an AMQP endpoint.
Definition: types.h:267
pn_session_t * pn_session(pn_connection_t *connection)
Factory for creating a new session on a given connection object.
void pn_session_set_context(pn_session_t *session, void *context)
Deprecated - Use pn_session_attachments().
pn_session_t * pn_session_next(pn_session_t *session, pn_state_t state)
Retrieve the next session from a given connection that matches the specified state mask...
pn_condition_t * pn_session_condition(pn_session_t *session)
Get the local condition associated with the session endpoint.