(client_id, sock, q_recv, q_send)
Send data to the connected clients.
Send data to the connected clients.
Send data to the connected clients .
def client_thread(client_id, sock, q_recv, q_send):
    """Send data to the connected clients."""
    #Connect to client and send feedback
    conn, addr = sock.accept()
    q_send.put(addr)
    
    #Remove items from queue sent before connection
    try:
        while not q_recv.empty():
            if q_recv.get() == MESSAGE_IGNORE:
                break
    except IOError:
        conn.close()
        return
    
    #Send each item to the client
    t = currentThread()
    while getattr(t, 'running', True):
        try:
            message = q_recv.get()
        except (IOError, EOFError):
            return
        try:
            send_msg(conn, message)
        except (socket.error, KeyboardInterrupt):
            conn.close()
            return
def client_thread ( client_id , sock , q_recv , q_send ) : #Connect to client and send feedback conn , addr = sock . accept ( ) q_send . put ( addr ) #Remove items from queue sent before connection try : while not q_recv . empty ( ) : if q_recv . get ( ) == MESSAGE_IGNORE : break except IOError : conn . close ( ) return #Send each item to the client t = currentThread ( ) while getattr ( t , 'running' , True ) : try : message = q_recv . get ( ) except ( IOError , EOFError ) : return try : send_msg ( conn , message ) except ( socket . error , KeyboardInterrupt ) : conn . close ( ) return