MCPcopy Create free account
hub / github.com/apache/qpid-proton / Program

Class Program

python/tests/proton_tests/engine.py:2153–2171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2151 server.start()
2152
2153 class Program:
2154
2155 def on_reactor_init(self, event):
2156 self.conn = event.reactor.connection()
2157 self.conn.hostname = "%s:%s" % (server.host, server.port)
2158 self.conn.open()
2159 self.old_count = None
2160 event.reactor.schedule(3 * idle_timeout, self)
2161
2162 def on_connection_bound(self, event):
2163 event.transport.idle_timeout = idle_timeout
2164
2165 def on_connection_remote_open(self, event):
2166 self.old_count = event.transport.frames_input
2167
2168 def on_timer_task(self, event):
2169 assert self.conn.state == (Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE), "Connection terminated"
2170 assert self.conn.transport.frames_input > self.old_count, "No idle frames received"
2171 self.conn.close()
2172
2173 Container(Program()).run()
2174 server.stop()

Callers 2

testKeepaliveMethod · 0.70
testIdleTimeoutMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected