@@ -345,6 +345,8 @@ async def sock_recv(self, sock, n):
345
345
The maximum amount of data to be received at once is specified by
346
346
nbytes.
347
347
"""
348
+ if isinstance (sock , ssl .SSLSocket ):
349
+ raise TypeError ("Socket cannot be of type SSLSocket" )
348
350
if self ._debug and sock .gettimeout () != 0 :
349
351
raise ValueError ("the socket must be non-blocking" )
350
352
fut = self .create_future ()
@@ -378,6 +380,8 @@ async def sock_recv_into(self, sock, buf):
378
380
The received data is written into *buf* (a writable buffer).
379
381
The return value is the number of bytes written.
380
382
"""
383
+ if isinstance (sock , ssl .SSLSocket ):
384
+ raise TypeError ("Socket cannot be of type SSLSocket" )
381
385
if self ._debug and sock .gettimeout () != 0 :
382
386
raise ValueError ("the socket must be non-blocking" )
383
387
fut = self .create_future ()
@@ -415,6 +419,8 @@ async def sock_sendall(self, sock, data):
415
419
raised, and there is no way to determine how much data, if any, was
416
420
successfully processed by the receiving end of the connection.
417
421
"""
422
+ if isinstance (sock , ssl .SSLSocket ):
423
+ raise TypeError ("Socket cannot be of type SSLSocket" )
418
424
if self ._debug and sock .gettimeout () != 0 :
419
425
raise ValueError ("the socket must be non-blocking" )
420
426
fut = self .create_future ()
@@ -451,6 +457,8 @@ async def sock_connect(self, sock, address):
451
457
452
458
This method is a coroutine.
453
459
"""
460
+ if isinstance (sock , ssl .SSLSocket ):
461
+ raise TypeError ("Socket cannot be of type SSLSocket" )
454
462
if self ._debug and sock .gettimeout () != 0 :
455
463
raise ValueError ("the socket must be non-blocking" )
456
464
@@ -508,6 +516,8 @@ async def sock_accept(self, sock):
508
516
object usable to send and receive data on the connection, and address
509
517
is the address bound to the socket on the other end of the connection.
510
518
"""
519
+ if isinstance (sock , ssl .SSLSocket ):
520
+ raise TypeError ("Socket cannot be of type SSLSocket" )
511
521
if self ._debug and sock .gettimeout () != 0 :
512
522
raise ValueError ("the socket must be non-blocking" )
513
523
fut = self .create_future ()
0 commit comments