467,075 Members | 979 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,075 developers. It's quick & easy.

sockets, select or: twisted and other file-descriptors

Hi,

I have a simple client-server app, that sits on a serial port and
communicates through that with an attached microcontroller-board. To the
outside, it exposes two sockets (file or inet) which can be connected by
clients to perform certain tasks like uploading programs, giving me a
console and resetting the board. So far, I've used threads - every incoming
connection generates one that will listen to the client socket using
socket.recv. Whatever comes from there is transmitted to the mc-board. The
answer is broadcasted to all listenig clients.

I now want to rewrite it using select and no more threads. If it was only a
network-application, I'd try to make my first steps using twisted. However,
I'm not sure if its possible to have twisteds select also take my
filedescriptors for the serial connection.

I could go for a two-thread approach, or maybe I can overload some twisted
class so that it works on my serial line as if it was a socket connection.

Any suggestions?

Regards,

Diez
Jul 18 '05 #1
  • viewed: 1862
Share:
1 Reply
"Diez B. Roggisch" wrote:

I now want to rewrite it using select and no more threads. If it was only a
network-application, I'd try to make my first steps using twisted. However,
I'm not sure if its possible to have twisteds select also take my
filedescriptors for the serial connection.


Twisted has some (or full?) support for serial ports, so you should
investigate it more closely to see just what it does and whether that
would work for your own application.

A download is free, and you can browse the source pretty easily to
get the gist of it. I suspect you'll see right away that it is or
is not suitable.

(Of course, someone else might be able to say "yeah, it works" or something
already, but there's no real substitute for just checking for yourself.)

-Peter
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Julia Goolia | last post: by
4 posts views Thread by jblazi | last post: by
3 posts views Thread by Ajay | last post: by
3 posts views Thread by OneMustFall | last post: by
6 posts views Thread by Maxim Veksler | last post: by
6 posts views Thread by geoffbache | last post: by
reply views Thread by huisan.wang@gmail.com | last post: by
reply views Thread by James Mills | last post: by
3 posts views Thread by Daniel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.