-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathc_connection.pxd
More file actions
69 lines (59 loc) · 4.14 KB
/
c_connection.pxd
File metadata and controls
69 lines (59 loc) · 4.14 KB
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
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
from libc cimport stdint
cimport c_amqp_definitions
cimport c_amqpvalue
cimport c_xio
cdef extern from "azure_uamqp_c/connection.h":
ctypedef struct CONNECTION_HANDLE:
pass
ctypedef struct ENDPOINT_HANDLE:
pass
ctypedef struct ON_CONNECTION_CLOSED_EVENT_SUBSCRIPTION_HANDLE:
pass
cdef enum CONNECTION_STATE_TAG:
CONNECTION_STATE_START,
CONNECTION_STATE_HDR_RCVD,
CONNECTION_STATE_HDR_SENT,
CONNECTION_STATE_HDR_EXCH,
CONNECTION_STATE_OPEN_PIPE,
CONNECTION_STATE_OC_PIPE,
CONNECTION_STATE_OPEN_RCVD,
CONNECTION_STATE_OPEN_SENT,
CONNECTION_STATE_CLOSE_PIPE,
CONNECTION_STATE_OPENED,
CONNECTION_STATE_CLOSE_RCVD,
CONNECTION_STATE_CLOSE_SENT,
CONNECTION_STATE_DISCARDING,
CONNECTION_STATE_END,
CONNECTION_STATE_ERROR
ctypedef CONNECTION_STATE_TAG CONNECTION_STATE
ctypedef void (*ON_CONNECTION_STATE_CHANGED)(void* context, CONNECTION_STATE new_connection_state, CONNECTION_STATE previous_connection_state)
ctypedef bint (*ON_NEW_ENDPOINT)(void* context, ENDPOINT_HANDLE new_endpoint)
ctypedef void (*ON_CONNECTION_CLOSE_RECEIVED)(void* context, c_amqp_definitions.ERROR_HANDLE error)
CONNECTION_HANDLE connection_create(c_xio.XIO_HANDLE io, const char* hostname, const char* container_id, ON_NEW_ENDPOINT on_new_endpoint, void* callback_context)
CONNECTION_HANDLE connection_create2(c_xio.XIO_HANDLE xio, const char* hostname, const char* container_id, ON_NEW_ENDPOINT on_new_endpoint, void* callback_context, ON_CONNECTION_STATE_CHANGED on_connection_state_changed, void* on_connection_state_changed_context, c_xio.ON_IO_ERROR on_io_error, void* on_io_error_context)
void connection_destroy(CONNECTION_HANDLE connection)
int connection_open(CONNECTION_HANDLE connection)
int connection_listen(CONNECTION_HANDLE connection)
int connection_close(CONNECTION_HANDLE connection, const char* condition_value, const char* description, c_amqpvalue.AMQP_VALUE info)
int connection_set_max_frame_size(CONNECTION_HANDLE connection, stdint.uint32_t max_frame_size)
int connection_get_max_frame_size(CONNECTION_HANDLE connection, stdint.uint32_t* max_frame_size)
int connection_set_channel_max(CONNECTION_HANDLE connection, stdint.uint16_t channel_max)
int connection_get_channel_max(CONNECTION_HANDLE connection, stdint.uint16_t* channel_max)
int connection_set_idle_timeout(CONNECTION_HANDLE connection, c_amqp_definitions.milliseconds idle_timeout)
int connection_get_idle_timeout(CONNECTION_HANDLE connection, c_amqp_definitions.milliseconds* idle_timeout)
int connection_set_properties(CONNECTION_HANDLE connection, c_amqp_definitions.fields properties)
int connection_get_properties(CONNECTION_HANDLE connection, c_amqp_definitions.fields* properties)
int connection_set_desired_capabilities(CONNECTION_HANDLE connection, c_amqpvalue.AMQP_VALUE desired_capabilities)
int connection_get_desired_capabilities(CONNECTION_HANDLE connection, c_amqpvalue.AMQP_VALUE* desired_capabilities)
int connection_get_remote_max_frame_size(CONNECTION_HANDLE connection, stdint.uint32_t* remote_max_frame_size)
int connection_set_remote_idle_timeout_empty_frame_send_ratio(CONNECTION_HANDLE connection, double idle_timeout_empty_frame_send_ratio)
stdint.uint64_t connection_handle_deadlines(CONNECTION_HANDLE connection)
void connection_dowork(CONNECTION_HANDLE connection) nogil
void connection_set_trace(CONNECTION_HANDLE connection, bint trace_on)
ON_CONNECTION_CLOSED_EVENT_SUBSCRIPTION_HANDLE connection_subscribe_on_connection_close_received(CONNECTION_HANDLE connection, ON_CONNECTION_CLOSE_RECEIVED on_connection_close_received, void* context)
void connection_unsubscribe_on_connection_close_received(ON_CONNECTION_CLOSED_EVENT_SUBSCRIPTION_HANDLE event_subscription)