41 lines
855 B
Python
41 lines
855 B
Python
'''
|
|
Created on 19 mar 2020
|
|
|
|
@author: Emanuele Trabattoni
|
|
@copyright: Briq srl
|
|
@contact: Scritto per Briq srl come collaboratore esterno, contiene dei frammenti di codice di proprieta' di Briq srl
|
|
'''
|
|
|
|
import threading, socket, sys, queue, logging
|
|
|
|
Q_TIMEOUT = 2
|
|
|
|
def stampante(q_in, q_out, ip, ):
|
|
pass
|
|
|
|
|
|
|
|
|
|
#lancia i thread, uno per stampante
|
|
def main(q_in :queue.Queue, q_out :queue.Queue, q_comm: queue.Queue, logger: logging.getLogger):
|
|
queue_ip_map={}
|
|
|
|
def get_queue_id(ip):
|
|
return True
|
|
|
|
def get_queue_command():
|
|
return q_comm
|
|
|
|
while True:
|
|
try:
|
|
comando = q_comm.get(block=True, timeout=Q_TIMEOUT)
|
|
if comando['name'] == "CONNETTI":
|
|
elif comando['name'] == "DISCONNETTI":
|
|
else:
|
|
out
|
|
logger.error("Comando non Trovato")
|
|
except Empty:
|
|
logger.error("Coda comandi vuota")
|
|
pass
|
|
|