@@ -42,16 +42,14 @@ cdef class Protocol:
42
42
bint _txn_in_progress
43
43
bint _break_in_progress
44
44
45
- def __init__ (self , sock ):
45
+ def __init__ (self ):
46
46
self ._caps = Capabilities()
47
- self .__set_socket(sock)
47
+ # mark protocol to indicate that connect is in progress; this prevents
48
+ # the normal break/reset mechanism from firing, which is unnecessary
49
+ # since the connection is going to be immediately closed anyway!
50
+ self ._in_connect = True
48
51
self ._request_lock = threading.RLock()
49
52
50
- cdef int __set_socket(self , sock):
51
- self ._socket = sock
52
- self ._read_buf = ReadBuffer(sock, TNS_SDU, self ._caps)
53
- self ._write_buf = WriteBuffer(sock, TNS_SDU, self ._caps)
54
-
55
53
cdef int _break_external(self ) except - 1 :
56
54
"""
57
55
Method for sending a break to the server from an external request. A
@@ -133,11 +131,6 @@ cdef class Protocol:
133
131
uint8_t packet_type
134
132
str connect_string
135
133
136
- # mark protocol to indicate that connect is in progress; this prevents
137
- # the normal break/reset mechanism from firing, which is unnecessary
138
- # since the connection is going to be immediately closed anyway!
139
- self ._in_connect = True
140
-
141
134
# store whether OOB processing is possible or not
142
135
self ._caps.supports_oob = not params.disable_oob \
143
136
and sys.platform != " win32"
@@ -175,7 +168,7 @@ cdef class Protocol:
175
168
ssl_context.check_hostname = False
176
169
sock = socket.socket(fileno = self ._socket.detach())
177
170
sock = ssl_context.wrap_socket(sock)
178
- self .__set_socket (sock)
171
+ self ._set_socket (sock)
179
172
180
173
cdef int _connect_phase_two(self , ThinConnImpl conn_impl,
181
174
Description description,
@@ -370,3 +363,8 @@ cdef class Protocol:
370
363
buf.write_uint8(0 )
371
364
buf.write_uint8(marker_type)
372
365
buf.end_request()
366
+
367
+ cdef int _set_socket(self , sock):
368
+ self ._socket = sock
369
+ self ._read_buf = ReadBuffer(sock, TNS_SDU, self ._caps)
370
+ self ._write_buf = WriteBuffer(sock, TNS_SDU, self ._caps)
0 commit comments