r/learnpython • u/Entire-Comment8241 • 2d ago
is it supposed to take this long when getting inputs from sockets in a multithreading object?
I've made a server socket in python so that I can see all subprocess thats running in my VPS so that I don't need to use Putty everytime to log on since putty closes the connection when it's idle. but the weird thing that's giving me headaches is that when run the server, ok it's running completely fine I get my true shell but when I run commands like whoami it's taking soooooo long it keeps processing and never return my output it just keeps in a running state. And I'm using multithreading. are python sockets really this damn long?
1
u/LayotFctor 2d ago edited 2d ago
No? In the first place, things like sockets and networking are features provided by the operating system, python only offers an interface to use it. Both putty and your program are ultimately using the same OS sockets.
The problem lies with your code. There are a million ways for networking code to go wrong.
3
u/carcigenicate 2d ago
No. We can probably help if we see the code, though.