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
						Carl Lerche
					
				
			
			
				
	
			
			
			
						parent
						
							a7b92d5ec2
						
					
				
				
					commit
					7f21954724
				
			| @@ -88,7 +88,9 @@ impl<T> FramedRead<T> { | ||||
|                 // TODO: implement | ||||
|                 return Ok(None); | ||||
|             } | ||||
|             Kind::Ping => unimplemented!(), | ||||
|             Kind::Ping => { | ||||
|                 try!(frame::Ping::load(head, &bytes[frame::HEADER_LEN..])).into() | ||||
|             } | ||||
|             Kind::GoAway => { | ||||
|                 let frame = try!(frame::GoAway::load(&bytes[frame::HEADER_LEN..])); | ||||
|                 debug!("decoded; frame={:?}", frame); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user