File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ impl<W: Write> StreamSession<W> {
2929 /// this is guaranteed to be flushed to the process
3030 /// returns number of written bytes
3131 pub fn send_line ( & mut self , line : & str ) -> Result < usize , Error > {
32- let mut len = self . send ( line) ?;
32+ let mut len = self . send_internal ( line) ?;
3333 len += self . writer . write ( & [ b'\n' ] ) ?;
34+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 10 ) ) ;
3435 Ok ( len)
3536 }
3637
@@ -39,6 +40,12 @@ impl<W: Write> StreamSession<W> {
3940 ///
4041 /// Returns number of written bytes
4142 pub fn send ( & mut self , s : & str ) -> Result < usize , Error > {
43+ let len = self . send_internal ( s) ?;
44+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 10 ) ) ;
45+ Ok ( len)
46+ }
47+
48+ fn send_internal ( & mut self , s : & str ) -> Result < usize , Error > {
4249 self . writer . write ( s. as_bytes ( ) ) . map_err ( Error :: from)
4350 }
4451
You can’t perform that action at this time.
0 commit comments