multiconn-client.py sometimes concatenates messages
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- networking
Hướng nghiên cứu
Bắt đầu với materials/python-sockets-tutorial/multiconn-client.py và multiconn-server.py, sau đó tái hiện vấn đề bằng hai lệnh được hiển thị khi server đang chạy trên 127.0.0.1:65432. Theo dõi cách client gửi và nhận hai thông báo cũng như cách server ghi nhật ký chúng; hoàn thành có nghĩa là lần chạy thứ hai báo cáo từng thông báo riêng biệt, khớp với lần chạy đầu tiên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@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
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 5.2k
- Fork
- 5.3k
- Merge trung bình
- 4 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của realpython/materials
-
Ruff lints the whole repo Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
realpython/materials#729 ·
-
п Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
realpython/materials#763 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 55/100
realpython/materials#738 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 45/100
realpython/materials#737 ·
-
проект2 Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
realpython/materials#725 ·
Tất cả issue của realpython/materials
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Add port prober support for IPv6 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
canonical/postgresql-watcher-operator#110 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
EleutherAI/lm-evaluation-harness#4201 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
possible bug Stage1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PrismarineJS/mineflayer#4147 ·