multiconn-client.py sometimes concatenates messages
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- networking
Direzione di ricerca
Inizia con materials/python-sockets-tutorial/multiconn-client.py e multiconn-server.py, quindi riproduci il problema usando i due comandi mostrati, con il server in esecuzione su 127.0.0.1:65432. Traccia come il client invia e riceve i due messaggi e come il server li registra; il lavoro è completato quando la seconda esecuzione riporta ogni messaggio separatamente, come nella prima esecuzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@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
- Lingua principale
- Jupyter Notebook
- Stelle
- 5.2k
- Fork
- 5.3k
- Merge medio
- 4g 10h
- PR unite (30g)
- 10
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di realpython/materials
-
Ruff lints the whole repo Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
realpython/materials#729 ·
-
п Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
realpython/materials#763 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
realpython/materials#738 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 45/100
realpython/materials#737 ·
-
проект2 Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
realpython/materials#725 ·
Tutte le issue di realpython/materials
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
canonical/postgresql-watcher-operator#110 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
EleutherAI/lm-evaluation-harness#4201 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
possible bug Stage1
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PrismarineJS/mineflayer#4147 ·