Opened 10 years ago
Closed 10 years ago
#3587 enhancement closed duplicate (duplicate)
deferred for loseConnection
Reported by: | ghazel | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Keywords: | |
Cc: | Branch: | ||
Author: |
Description
twisted.internet.abstract.FileDescriptor.loseConnection either completes immediately or finishes asynchronously. Similar to twisted.internet.tcp.Port.loseConnection, it would be nice if a deferred was returned when the operation did not complete immediately.
Specifically, it would be nice if the deferred fired -after- the event handler for connectionLost, similar to twisted.internet.tcp.Port.loseConnection. For example, this would be ideal:
class MyProtocol(Protocol): def dataReceived(self, data): print 'data' df = maybeDeferred(self.transport.loseConnection) df.addCallback(lambda : sys.stdout.write('callback\n')) def connectionLost(self, reason): print 'connectionLost'
resulting the following, whether the operation was deferred or not:
data connectionLost callback
Change History (2)
comment:1 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 Changed 8 years ago by
Owner: | Glyph deleted |
---|
Note: See
TracTickets for help on using
tickets.
oops. dupe of #1128