realpython / realpython/materials
Sockets of multi connect server's client do not close on minor change from eco server to normal server and normal client
还没有人认领这个 Issue。
- 主要语言
- Jupyter Notebook
- 星标
- 5.2k
- 派生
- 5.3k
- 平均合并
- 4 天 10 小时
- 30 天内合并 PR
- 10
描述
ℹ️
After I use it (https://github.com/realpython/materials/blob/master/python-sockets-tutorial/multiconn-client.py) with a small change (minor change from echo server to normal server) -
- after sending and receiving messages from the client and server, the client does not close; or
- all data.messages have been exausted, the client does not close.
You can report issues and problems here, but we typically won't be able to provide 1:1 support outside the channels listed above.
Describe the bug
After minor change from echo server to normal server:
- after sending and receiving messages from the client and server, the client does not close; or
- all data.messages have been exausted, the client does not close.
To Reproduce
Provided in the stackoverflow question
Expected behavior
The client should close. Looks like it does not get into the if not recv_data code while I was checking. The program should reach the code. No major changes to the code has been made other than sending data from messages section. :
if not recv_data:
print("closing connection", data.connid)
sel.unregister(sock)
sock.close()
Screenshots
Added to link:
https://stackoverflow.com/questions/70640602/sockets-in-python-client-not-closing-after-event-read-write-events-in-multi-conn
Desktop (please complete the following information):
- OS: [e.g. iOS] Win, Linux
Additional context
NA
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 python-sockets-tutorial/multiconn-client.py 和链接的 Stack Overflow 复现开始;将 echo-server 的更改与所描述的 normal-server 流程进行比较。确认消息耗尽后,客户端会到达所示的 if not recv_data 分支并关闭。完成意味着客户端在所描述的两种情况下都能可靠地关闭。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- networking
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100