Author pfreixes
Recipients Dima.Tisnek, gvanrossum, pfreixes, yselivanov
Date 2017-07-06.21:04:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499375062.97.0.701646595603.issue30861@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-07-06 21:04:22pfreixessetrecipients: + pfreixes, gvanrossum, Dima.Tisnek, yselivanov
2017-07-06 21:04:22pfreixessetmessageid: <1499375062.97.0.701646595603.issue30861@psf.upfronthosting.co.za>
2017-07-06 21:04:22pfreixeslinkissue30861 messages
2017-07-06 21:04:22pfreixescreate