Implement ping_pong (#1)
* comments * wip * wip * Sketch out pingpong and keepalive stack modules PingPong responds to ping requests with acknowledgements. KeepAlive issues ping requests on idle connections. * remove keepalive for now * commentary * prettify ping_pong's poll * test ping pong and passthrough * add buffering test * Use a fixed-size slice for ping payloads * Improve pong dispatch pong messages should be buffered until Stream::poll returns Async::NotReady or Async::Ready(None) (i.e. such that it is not expected to be polled again). pong messages are now dispatched when no more data may be polled or the Sink half is activated. * revert name change * touchup * wip * Simplify Stream::poll Now PingPong only holds at most one pending pong and the stream will not produce additional frames unti the ping has been sent. Furthermore, we shouldn't have to call inner.poll_complete quite so frequently. * avoid Bytes::split_to * only use buf internally to Ping::load
This commit is contained in:
committed by
Carl Lerche
parent
a7b92d5ec2
commit
7f21954724
@@ -46,7 +46,7 @@ pub fn from_io<T, P>(io: T, settings: frame::SettingSet)
|
||||
// Map to `Frame` types
|
||||
let framed = FramedRead::new(framed_read);
|
||||
|
||||
// Add ping/pong handler
|
||||
// Add ping/pong responder.
|
||||
let ping_pong = PingPong::new(framed);
|
||||
|
||||
// Add settings handler
|
||||
|
||||
Reference in New Issue
Block a user