aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-net/src')
-rw-r--r--embassy-net/src/tcp_socket.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/embassy-net/src/tcp_socket.rs b/embassy-net/src/tcp_socket.rs
index 4836f8075..5637505d4 100644
--- a/embassy-net/src/tcp_socket.rs
+++ b/embassy-net/src/tcp_socket.rs
@@ -58,7 +58,7 @@ impl<'a> TcpSocket<'a> {
58 .await 58 .await
59 } 59 }
60 60
61 pub async fn listen<T>(&mut self, local_endpoint: T) -> Result<()> 61 pub async fn accept<T>(&mut self, local_endpoint: T) -> Result<()>
62 where 62 where
63 T: Into<IpEndpoint>, 63 T: Into<IpEndpoint>,
64 { 64 {
@@ -66,9 +66,7 @@ impl<'a> TcpSocket<'a> {
66 66
67 futures::future::poll_fn(|cx| { 67 futures::future::poll_fn(|cx| {
68 self.with(|s, _| match s.state() { 68 self.with(|s, _| match s.state() {
69 TcpState::Closed | TcpState::TimeWait => Poll::Ready(Err(Error::Unaddressable)), 69 TcpState::Listen | TcpState::SynSent | TcpState::SynReceived => {
70 TcpState::Listen => Poll::Ready(Ok(())),
71 TcpState::SynSent | TcpState::SynReceived => {
72 s.register_send_waker(cx.waker()); 70 s.register_send_waker(cx.waker());
73 Poll::Pending 71 Poll::Pending
74 } 72 }