Implement `Stream::close` for WebSocket

pull/1/head
Daniel Abramov 7 years ago
parent 50c218aac5
commit 16c4693c91
  1. 4
      src/lib.rs

@ -133,6 +133,10 @@ impl<T> Sink for WebSocketStream<T> where T: AsyncRead + AsyncWrite {
fn poll_complete(&mut self) -> Poll<(), WsError> { fn poll_complete(&mut self) -> Poll<(), WsError> {
self.inner.write_pending().to_async() self.inner.write_pending().to_async()
} }
fn close(&mut self) -> Poll<(), WsError> {
self.inner.close(None).to_async()
}
} }
/// Future returned from client_async() which will resolve /// Future returned from client_async() which will resolve

Loading…
Cancel
Save