Ticket #3313: interfaces.patch

File interfaces.patch, 1.4 KB (added by cary, 7 years ago)
  • twisted/internet/interfaces.py

     
    12581264        """
    12591265        Notification of the read connection being closed.
    12601266
    1261         This indicates peer did half-close of write side. It is now
    1262         the responsiblity of the this protocol to call
    1263         loseConnection().  In addition, the protocol MUST make sure a
    1264         reference to it still exists (i.e. by doing a callLater with
    1265         one of its methods, etc.)  as the reactor will only have a
    1266         reference to it if it is writing.
     1267        This indicates that the peer has closed its write side.
     1268        It will now be this protocol's responsiblity to ensure loseConnection()
     1269        gets called.
    12671270
    1268         If the protocol does not do so, it might get garbage collected
    1269         without the connectionLost method ever being called.
     1271        In addition, a reference to this protocol MUST be kept alive somewhere
     1272        or there will be no way to trigger writing. This is because there will
     1273        be no further dataReceived() events to rely on as the reactor will
     1274        not hold references to related file descriptors.
     1275       
     1276        Not keeping a live reference to this protocol may result in it
     1277        being garbage collected without connectionLost() getting called.
    12701278        """
    12711279
    12721280    def writeConnectionLost():