From: Antoine Pitrou Date: Wed, 15 Sep 2010 08:39:25 +0000 (+0000) Subject: Add a comment explaining why SocketIO is needed X-Git-Tag: v3.2a3~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=872b79d02f97d7560d8a0c57d3665cdbefb98f5a;p=python Add a comment explaining why SocketIO is needed --- diff --git a/Lib/socket.py b/Lib/socket.py index 9b5b23d135..2861e0db8f 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -228,6 +228,13 @@ class SocketIO(io.RawIOBase): the raw I/O interface on top of a socket object. """ + # One might wonder why not let FileIO do the job instead. There are two + # main reasons why FileIO is not adapted: + # - it wouldn't work under Windows (where you can't used read() and + # write() on a socket handle) + # - it wouldn't work with socket timeouts (FileIO would ignore the + # timeout and consider the socket non-blocking) + # XXX More docs def __init__(self, sock, mode):