0

I need a way to handle multiple socket connections and keep the connection open (like JS socket.io do!).

I will have 20 clients (machines) and a list of servers, each client need to establish a connection with each server and I cannot support this with threading.

I already do this with a threading system but it will cost too much on my system.

My last try was with Asyncore but without success on my purpose.

All results I find uses a threading based system. Any suggestions?

Denis V
  • 421
  • 4
  • 17
  • 1
    Use `select.select` to wait for activity on multiple sockets. – Barmar Aug 12 '17 at 00:15
  • 1
    "...I cannot support this with threading...". With 20 clients? Of course you can. – President James K. Polk Aug 12 '17 at 00:17
  • I'll read about it @Barmar – Denis V Aug 12 '17 at 00:18
  • I had a Bottle application on the machine receiving requests by all 20 clients each 4 seconds and it gives me many Broken Pipes. Now i've setted to 7 seconds and works fine. As I want more 'real time' communication I thought that sockets would be the best thing to implement, but without threads because my machine resources are limited. (@JamesKPolk) – Denis V Aug 12 '17 at 00:24
  • For I/O bound applications python threads are quite efficient. If you are having problems it's probably due to some reason *other* than the fact that you are using threads. – President James K. Polk Aug 12 '17 at 00:26

0 Answers0