pfreixes added the comment:

As was said, the assumption here is the data that came to the buffer must be 
available.

For example, the next snippet shows a Redis client that expects the data 
message plus the RST packet, where the redis-server was configured to accept 
max N connections, the connection used by this snippet was the N+1

import socket
import time

s = socket.socket(
    socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 6379))

# give enought time to get the
# data plus the RST Package
time.sleep(1)

# read the data
print(s.recv(100))

It works like a charm.

IMHO this is not a matter of RST vs close graceful, its a matter of giving 
always the chance to the developer to read the data that is still remaining and 
ready into the buffer.

The current implementation is in somehow not predictable. Different network 
latencies with the same scenario can produce different outputs and the same 
with how the read of the Streamer is handled by the developer.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30861>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to