'The *server* has a timeout mechanism which will close connections that
are inactive for a period.'

def test_idleClientDoesDisconnect(self):

    c = Clock()
    transport = StringTransportWithDisconnection()
    transport.protocol = self.server
    self.server.callLater = c.callLater
    self.server.makeConnection(transport)
    lost = []
    connLost = self.server.connectionLost
    self.server.connectionLost = (lambda reason: (lost.append(None), connLost(reason))[1])
    c.pump(([0.0] + ([(self.server.timeOut / 3.0)] * 2)))
    self.assertFalse(lost, lost)
    c.pump([0.0, (self.server.timeOut / 2.0)])
    self.assertTrue(lost)
