On Sun, Oct 03, 2004 at 07:50:50PM +0900, Dick Davies scribed:
> * Siegfried Heintze <siegfried / heintze.com> [1024 05:24]:
> > I need to write a program similar to a telnet server. A telnet server
> > asynchronously reads data from a socket and writes it to a
> > sub-process, and asynchronously reads data from the subprocess and
> > writes to a socket. My program needs to replace the subprocess with a
> > serial port.
> 
> do you mean like tits? It's in C and written for NetBSD, but should be
> easy enough to port to another *NIX. It should at least give you an idea
> how the framework would work:

tits is probably what you want (what an unfortunate name for
a program).  If you're really set on rewriting it in ruby, you
might find that my serial port management program helps get
you started, though beware -- it cuts a lot of corners because
it's connecting to a telnet server on the other end that handles
all of the telnet option negotiation and ugliness.

# multiconsole.rb - permit multiple concurrent 'telnet' processes
# to access a serial console server.  All telnets see the same
# session (as a design choice), so don't use it for ordinary
# access.  Convenient for having a console in your office
# and down in the machine room, though...

  http://eep.lcs.mit.edu/multiconsole.rb

It's a cheap hack, but it's mighty convenient. :)

  -dave

-- 
work: dga / lcs.mit.edu                          me:  dga / pobox.com
      MIT Laboratory for Computer Science           http://www.angio.net/