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
Personne n'a encore pris cette issue.
- Langage dominant
- Jupyter Notebook
- Étoiles
- 5.2k
- Forks
- 5.3k
- Merge moyen
- 4 j 10 h
- PR mergées (30 j)
- 10
Description
ℹ️
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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par python-sockets-tutorial/multiconn-client.py et la reproduction Stack Overflow liée ; comparez la modification de echo-server avec le flux normal-server décrit. Vérifiez qu’une fois les messages épuisés, le client atteint la branche if not recv_data montrée et se ferme. C’est terminé lorsque le client se ferme de manière fiable dans les deux cas décrits.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- networking
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100