def test_server_push(io_loop, host, port):
c = H2Client(io_loop=io_loop)
yield c.connect(host, port)
print("Sending HTTP/2 request with Server Push")
now = time.time()
response = yield c.get_request("/")
yield gen.sleep(1)
total_time = c.last_time_data_recvd - now
print(
"Pushes Received: {}\nTotal data received: {} bytes\nDuration: {}s\nRate: {} Bps\n".format(
len(c.pushes),
c.data_received_size,
total_time,
c.data_received_size/total_time
)
)
#print response
c.close_connection()
评论列表
文章目录