RT-Thread / RT-Thread/rt-thread
LWIP2.0.2断线无法重连问题
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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