#๐ Problem with sockets/threading
18 messages ยท Page 1 of 1 (latest)
@cyan quarry
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
server.py file:
https://paste.pythondiscord.com/E3FA
client.py:
https://paste.pythondiscord.com/S5QQ
so, the problem, that when I trying to create a "session" between two clients, its work until some client write something, after writing something code just stopping at this client and this error at the server:
Error accepting connection: [WinError 10038] An operation was attempted on something that is not a socket
Is the error on the client or server end?
That error typically means that you accidentally closed the socket before attempting to use it.
my client just stopping, and error on the server
Can you show an example terminal session for both the client and server?
Also note, your use of recv and send is unsafe. Those methods are not guarenteed to fully send/recieve all the text at once. You'll want to read this. I don't think that's your current issue, but it will become an issue.
I don't see anything obvious. Unfortunately, I need to go. I'll look back on this later and see if I can spot anything.
I just realized that the error in that least screenshot is different than your original error.
oh, really)
Winerror 10054 vs 10038
response = input("Do you want to start a session with this user? (yes/no): ").strip().lower()
Is this not just a timeout? Your client is waiting for you to enter text.
yea, but u can start the program, and u will see that u can not see this text
perhaps the prompt didnt show up because your client's send_messages thread is already waiting on input()?
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
๐ Problem with sockets/threading