Ticket #3690 defect closed fixed
SerialPort never calls connectionLost(reason)
Description
Here is a minimal working example showing the problem.
from twisted.internet.serialport import SerialPort
from twisted.protocols.basic import LineOnlyReceiver
from twisted.internet import reactor
class SerialProtocol(LineOnlyReceiver):
def connectionMade(self):
print 'connection made'
self.transport.loseConnection()
def connectionLost(self, reason):
print 'connectionLost called'
port = SerialPort(SerialProtocol(), '/dev/ttyUSB2', reactor)
reactor.callLater(10, reactor.stop)
reactor.run()
This prints:
# python testserial.py Connection made #
And it should print:
# python testserial.py Connection made connectionLost called #
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

