Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26879

Re: Threads and sockets

From Dieter Maurer <dieter@handshake.de>
Subject Re: Threads and sockets
Date 2012-08-10 18:38 +0200
References <775f30ad-1f04-4653-95c4-b0dfdd27ca49@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.3168.1344616733.4697.python-list@python.org> (permalink)

Show all headers | View raw


loial <jldunn2000@gmail.com> writes:

> 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)?

That should be possible. Alternatively, you could use "asyncore" -- a
mini framework to facilitate asynchronous communication.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Threads and sockets loial <jldunn2000@gmail.com> - 2012-08-10 06:01 -0700
  Re: Threads and sockets Dieter Maurer <dieter@handshake.de> - 2012-08-10 18:38 +0200
  Re: Threads and sockets Grant Edwards <invalid@invalid.invalid> - 2012-08-10 22:38 +0000
  Re: Threads and sockets Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-08-13 09:15 +0200

csiph-web