RT-Thread / RT-Thread/rt-thread

LWIP2.0.2断线无法重连问题

Open
#8,318 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

RTT做服务端监听端口成功,当应用层接收线程挂在recv函数等待接收时,如果网线断开再重连,无法接收到新的数据,排查原因可能是当前建立的sock对象句柄已被改变,底层接收中断可以接到数据但无法返回给recv函数。
尝试客户端主动断开,recv可返回接收0字节从而退出循环重新连接客户端。请问当网络异常断开时 用何机制可以退出recv从而接受新的socket连接呢?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the LWIP2.0.2 server case described: leave the application thread blocked in recv, disconnect and reconnect the network cable, and observe whether the existing socket receives data. Compare this with the client-initiated disconnect, where recv returns zero bytes, and identify the mechanism needed to exit recv and accept a new socket connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.