Threads and sockets

loial jldunn2000 at gmail.com
Fri Aug 10 09:01:25 EDT 2012


I am writing an application to send data to a printer port(9100) and then recieve PJL responses back on that port. Because of the way PJL works I have to do both in the same process(script).

At the moment I do not start to read responses until the data has been sent to the printer. However it seems I am missing some responses from the printer whilst sending the data, so I need to be able to do the 2 things at the same time.

Can I open a port once and then use 2 different threads, one to write to the post and one to read the responses)?
 

 




More information about the Python-list mailing list