File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ impl Connection {
6060 todo ! ( ) ;
6161 }
6262
63- pub async fn connect (
63+ pub ( crate ) async fn connect (
6464 stream : TcpStream ,
6565 addr : SocketAddr ,
6666 host_key : Arc < Ed25519KeyPair > ,
@@ -69,12 +69,12 @@ impl Connection {
6969 todo ! ( )
7070 }
7171
72- pub async fn recv_packet ( & mut self ) -> anyhow:: Result < Packet < ' _ > > {
73- todo ! ( )
72+ pub ( crate ) async fn recv_packet ( & mut self ) -> anyhow:: Result < Packet < ' _ > > {
73+ Ok ( self . stream_read . read_packet ( ) . await ? )
7474 }
7575
76- pub async fn send_packet ( & mut self , packet : impl Encode ) -> anyhow:: Result < ( ) > {
77- todo ! ( )
76+ pub ( crate ) async fn send_packet ( & mut self , payload : & impl Encode ) -> anyhow:: Result < ( ) > {
77+ Ok ( self . stream_write . write_packet ( payload , |_| { } ) . await ? )
7878 }
7979}
8080
You can’t perform that action at this time.
0 commit comments