Connections opened by listeners now close correctly.
2 # Tests the closing negotiation facilities of the BLIP 1.1 protocol
4 from BLIP import Connection, OutgoingRequest
10 class CloseTestPing(unittest.TestCase):
12 def handleCloseRefusal(self, resp):
13 logging.info("Close request was refused!")
16 self.connection = Connection( ('localhost', 1337) )
17 self.connection.onCloseRefused = self.handleCloseRefusal
19 def handleResponse(self, resp):
20 logging.info("Got response...")
23 req = OutgoingRequest(self.connection, "Ping")
24 req.response.onComplete = self.handleResponse
27 asyncore.loop(timeout=0, count=5)
29 self.connection.close()
34 if __name__ == '__main__':
35 logging.basicConfig(level=logging.DEBUG)