sockets and pipes....
From: Captain Dondo (yan_at_NsOeSiPnAeMr.com)
Date: 10/15/05
- Previous message: Matthias Apitz: "send(2) syscall on socket not returning as fast as possible"
- Next in thread: Neil T. Dantam: "Re: sockets and pipes...."
- Reply: Neil T. Dantam: "Re: sockets and pipes...."
- Reply: Jean-David Beyer: "Re: sockets and pipes...."
- Reply: Bob Smith: "Re: sockets and pipes...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 15 Oct 2005 06:25:52 -0700
I've got a socket/pipe question....
I have a master process that communicates with a whole bunch of hardware
(things like temperature sensors, position sensors, switches, and so on.)
I also have some number of processes that need to either get the status of
that hardware or to control it somehow (i.e. get a temperature reading or
turn a switch on).
I've been playing with named pipes and sockets but I can't help but think
I am reinventing the wheel....
Essentially the conversations between the processes are very simple.
Master process listens. Client makes a request (what is the
temperature?). Master process responds (It's 37 degrees.). Client closes
connection.
I'd like to set up something like a pty structure, where the client and
master communicate. When the client starts, it requests a connection.
The master process assigns it a socket or a pair of pipes, on which
the conversations will thake place.
Speed is not an issue; the communication bus the master process is
connected to runs at the leisurely speed of 800 bits per second.
Reliability is essential; I cannot have either the client or the server
block forever or die. Right now I am using pthreads - the client launches
a timeout thread, then a listen thread. Then it waits for the timeout
thread. If the listen thread completes, it kills the timeout thread.
Otehrwise the listen thread is killed once the timeout thread expires.
I've been playing with pipes and sockets but I can't help but think I am
reinventing the wheel. Does anyone know of a library that implements
something like this - along with all of the error checking and all that?
Thanks,
--Yan
- Previous message: Matthias Apitz: "send(2) syscall on socket not returning as fast as possible"
- Next in thread: Neil T. Dantam: "Re: sockets and pipes...."
- Reply: Neil T. Dantam: "Re: sockets and pipes...."
- Reply: Jean-David Beyer: "Re: sockets and pipes...."
- Reply: Bob Smith: "Re: sockets and pipes...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|