Multiple Connections Server
Building a Multiple Listener Using select
selectCreating the Socket
import select, socket, sys, Queue
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setblocking(0)
server.bind(('localhost', 9999))
server.listen(5)
inputs = [server]
outputs = []
message_queues = {}Taking input from the client
Sending outputs to the clients
Treating exceptions
Full Code
Last updated