Debian Codegraph @

src/wsio.pyx

raw
1 # Copyright (c) Microsoft Corporation. All rights reserved.
2 # Licensed under the MIT License. See License.txt in the project root for
3 # license information.
4 #--------------------------------------------------------------------------
5
6 # C imports
7 cimport c_wsio
8 cimport c_tlsio
9 cimport c_xio
10
11
12 DEFAULT_WS_PORT = 443
13 cdef const char* DEFAULT_WS_PROTOCOL_NAME = "AMQPWSB10"
14 cdef const char* DEFAULT_WS_RELATIVE_PATH = "/$servicebus/websocket/"
15
16
17 cdef class WSIOConfig(object):
18
19 cdef c_wsio.WSIO_CONFIG _c_value
20
21 def __cinit__(self):
22 self._c_value = c_wsio.WSIO_CONFIG(NULL, DEFAULT_WS_PORT, DEFAULT_WS_RELATIVE_PATH, DEFAULT_WS_PROTOCOL_NAME, NULL, NULL)
23
24 @property
25 def hostname(self):
26 return self._c_value.hostname
27
28 @hostname.setter
29 def hostname(self, const char* value):
30 self._c_value.hostname = value
31
32 @property
33 def port(self):
34 return self._c_value.port
35
36 @port.setter
37 def port(self, int port):
38 self._c_value.port = port
39
40 @property
41 def resource_name(self):
42 return self._c_value.resource_name
43
44 @resource_name.setter
45 def resource_name(self, const char* value):
46 self._c_value.resource_name = value
47
48 @property
49 def protocol(self):
50 return self._c_value.protocol
51
52 @protocol.setter
53 def protocol(self, const char* value):
54 self._c_value.protocol = value
55
56 cpdef set_tlsio_config(self, IOInterfaceDescription underlying_io_interface, TLSIOConfig underlying_io_parameters):
57 self._c_value.underlying_io_interface = underlying_io_interface._c_value
58 self._c_value.underlying_io_parameters = &underlying_io_parameters._c_value