@@ -42,16 +42,14 @@ cdef class Protocol:
4242 bint _txn_in_progress
4343 bint _break_in_progress
4444
45- def __init__ (self , sock ):
45+ def __init__ (self ):
4646 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
4851 self ._request_lock = threading.RLock()
4952
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-
5553 cdef int _break_external(self ) except - 1 :
5654 """
5755 Method for sending a break to the server from an external request. A
@@ -133,11 +131,6 @@ cdef class Protocol:
133131 uint8_t packet_type
134132 str connect_string
135133
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-
141134 # store whether OOB processing is possible or not
142135 self ._caps.supports_oob = not params.disable_oob \
143136 and sys.platform != " win32"
@@ -175,7 +168,7 @@ cdef class Protocol:
175168 ssl_context.check_hostname = False
176169 sock = socket.socket(fileno = self ._socket.detach())
177170 sock = ssl_context.wrap_socket(sock)
178- self .__set_socket (sock)
171+ self ._set_socket (sock)
179172
180173 cdef int _connect_phase_two(self , ThinConnImpl conn_impl,
181174 Description description,
@@ -370,3 +363,8 @@ cdef class Protocol:
370363 buf.write_uint8(0 )
371364 buf.write_uint8(marker_type)
372365 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