diff options
| -rw-r--r-- | embassy-net/src/tcp.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs index b9e494fc4..c3d8764b0 100644 --- a/embassy-net/src/tcp.rs +++ b/embassy-net/src/tcp.rs | |||
| @@ -63,6 +63,10 @@ impl<'a> TcpWriter<'a> { | |||
| 63 | pub async fn write(&mut self, buf: &[u8]) -> Result<usize, Error> { | 63 | pub async fn write(&mut self, buf: &[u8]) -> Result<usize, Error> { |
| 64 | self.io.write(buf).await | 64 | self.io.write(buf).await |
| 65 | } | 65 | } |
| 66 | |||
| 67 | pub async fn flush(&mut self) -> Result<(), Error> { | ||
| 68 | self.io.flush().await | ||
| 69 | } | ||
| 66 | } | 70 | } |
| 67 | 71 | ||
| 68 | impl<'a> TcpSocket<'a> { | 72 | impl<'a> TcpSocket<'a> { |
| @@ -146,6 +150,10 @@ impl<'a> TcpSocket<'a> { | |||
| 146 | self.io.write(buf).await | 150 | self.io.write(buf).await |
| 147 | } | 151 | } |
| 148 | 152 | ||
| 153 | pub async fn flush(&mut self) -> Result<(), Error> { | ||
| 154 | self.io.flush().await | ||
| 155 | } | ||
| 156 | |||
| 149 | pub fn set_timeout(&mut self, duration: Option<Duration>) { | 157 | pub fn set_timeout(&mut self, duration: Option<Duration>) { |
| 150 | self.io.with_mut(|s, _| s.set_timeout(duration)) | 158 | self.io.with_mut(|s, _| s.set_timeout(duration)) |
| 151 | } | 159 | } |
