multiconn-client.py sometimes concatenates messages
維護者通常 5 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- networking
研究方向
從 materials/python-sockets-tutorial/multiconn-client.py 和 multiconn-server.py 開始,接著在 server 執行於 127.0.0.1:65432 時,使用所示的兩個命令重現問題。追蹤 client 如何傳送及接收兩則訊息,以及 server 如何記錄它們;完成的標準是第二次執行分別回報每則訊息,並與第一次執行相符。
由索引模型根據 Issue 內容生成。
描述
@dbader, thanks very much for your example code.
Description of the bug
Running the multi-connection example from the python-sockets-tutorial, ie,
- materials/python-sockets-tutorial/multiconn-client.py
sometimes, but not always, concatenates the two messages.
To Reproduce
Start the server and view the output from when the client is run (see below)
python -u multiconn-server.py 127.0.0.1 65432
listening on ('127.0.0.1', 65432)
accepted connection from ('127.0.0.1', 50484)
echoing b'Message 1 from client.' to ('127.0.0.1', 50484)
echoing b'Message 2 from client.' to ('127.0.0.1', 50484)
closing connection to ('127.0.0.1', 50484)
accepted connection from ('127.0.0.1', 50486)
echoing b'Message 1 from client.Message 2 from client.' to ('127.0.0.1', 50486)
closing connection to ('127.0.0.1', 50486)
Run the client twice with 1 connection (see below). The first run gives expected results, the second run concatenates the two messages (as can be seen below). The concatenation is also evident in the output from multiconn-server.py above.
python -u multiconn-client.py 127.0.0.1 65432 1
starting connection 1 to ('127.0.0.1', 65432)
sending b'Message 1 from client.' to connection 1
sending b'Message 2 from client.' to connection 1
received b'Message 1 from client.' from connection 1
received b'Message 2 from client.' from connection 1
closing connection 1
python -u multiconn-client.py 127.0.0.1 65432 1
starting connection 1 to ('127.0.0.1', 65432)
sending b'Message 1 from client.' to connection 1
sending b'Message 2 from client.' to connection 1
received b'Message 1 from client.Message 2 from client.' from connection 1
closing connection 1
Expected behavior
The output form the second run of the multiconn-client.py should be identical to the output from the first run.
Desktop (please complete the following information):
- OS: CentOS 7
- Browser: Firefox
- Version 91.2.0esr (64-bit)
Additional context
Python 3.8.0
- 主要語言
- Jupyter Notebook
- 星號
- 5.2k
- 分支
- 5.3k
- 平均合併
- 5 天 2 小時
- 30 天內合併 PR
- 11
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
realpython/materials 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
realpython/materials#729 ·
維護者通常 5 天內回覆
-
п未關閉
難度 5/5 一週以上 新手友好度 1/100
realpython/materials#763 ·
維護者通常 5 天內回覆
-
難度 1/5 1 小時以內 新手友好度 55/100
realpython/materials#738 ·
維護者通常 5 天內回覆
-
難度 1/5 1 小時以內 新手友好度 45/100
realpython/materials#737 ·
維護者通常 5 天內回覆
-
проект2未關閉
難度 5/5 一週以上 新手友好度 15/100
realpython/materials#725 ·
維護者通常 5 天內回覆
查看 realpython/materials 的全部 Issue
相似的 Issue
-
There are a few redundant calls to `fdesc._setCloseOnExec()`可能已有人在做 @gudnimg 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
TooTallNate/proxy-agents#506 ·
-
bug Component component: net
難度 1/5 1 小時以內 新手友好度 90/100
RT-Thread/rt-thread#11852 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
btclib-org/btclib-node#1739 ·
維護者通常 1 天內回覆