Kaulkwappe <[email protected]> added the comment:
Thank you for your answer Christian. Indeed it seems a little more complex. As
I worked with Non-TLS sockets before it looked like unexpected behaviour to me
as on non-blocking sockets socket.send() would normally return 0 when no data
was sent.
By the way this is the code I currently use:
Code:
n = 0
while 1:
time.sleep(0.001)
try:
buffer = socket.recv(8192)
if not buffer:
break
except OSError:
print('{0}. try to send:'.format(n), len(blark),
'bytes')
try:
sent = socket.send(blark)
except ssl.SSLWantWriteError:
sent = 0
n += 1
print('Bytes sent:', sent)
else:
[...]
Result:
1. try to send: 33554469 bytes
Bytes sent: 0
[...]
137. try to send: 33554469 bytes
Bytes sent: 0
138. try to send: 33554469 bytes
Bytes sent: 0
139. try to send: 33554469 bytes
Bytes sent: 33554469
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33307>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com