File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -935,6 +935,27 @@ async def client(addr):
935
935
936
936
writer .close ()
937
937
938
+ async def client_sock (addr ):
939
+ sock = socket .socket ()
940
+ sock .connect (addr )
941
+ reader , writer = await asyncio .open_connection (
942
+ sock = sock ,
943
+ ssl = client_sslctx ,
944
+ server_hostname = '' ,
945
+ loop = self .loop )
946
+
947
+ writer .write (A_DATA )
948
+ self .assertEqual (await reader .readexactly (2 ), b'OK' )
949
+
950
+ writer .write (B_DATA )
951
+ self .assertEqual (await reader .readexactly (4 ), b'SPAM' )
952
+
953
+ nonlocal CNT
954
+ CNT += 1
955
+
956
+ writer .close ()
957
+ sock .close ()
958
+
938
959
def run (coro ):
939
960
nonlocal CNT
940
961
CNT = 0
@@ -956,6 +977,9 @@ def run(coro):
956
977
with self ._silence_eof_received_warning ():
957
978
run (client )
958
979
980
+ with self ._silence_eof_received_warning ():
981
+ run (client_sock )
982
+
959
983
960
984
class Test_UV_TCPSSL (_TestSSL , tb .UVTestCase ):
961
985
Original file line number Diff line number Diff line change @@ -1479,7 +1479,6 @@ cdef class Loop:
1479
1479
' host and port was not specified and no sock specified' )
1480
1480
1481
1481
waiter = self ._new_future()
1482
- protocol = protocol_factory()
1483
1482
tr = TCPTransport.new(self , protocol, None , waiter)
1484
1483
try :
1485
1484
# libuv will make socket non-blocking
You can’t perform that action at this time.
0 commit comments