Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Nov 1998 23:25:57 +0200 (EET)
From:      Andrew Stesin <fbsd@trifork.gu.net>
To:        hackers@FreeBSD.ORG, questions@FreeBSD.ORG
Subject:   Semi-realtime programming Q (RS-232, timers)
Message-ID:  <Pine.BSF.4.05.9811082307300.11274-100000@trifork.gu.net>

next in thread | raw e-mail | index | archive | help

Hello,

sorry for asking probably a FAQ, this is somewhat general
question.  Maybe you'll drop just a word or two with a pointer to a sample
code?

I'm now implementing (almost close to a victory :) a protocol
for communication with an external device(s) over RS-232 serial
port(s).  FreeBSD-3.0, of course. :) Comparatively simple protocol,
character oriented, but not that dumb at all.
What I need is to implement multiple timers for protocl FSM
to react onto, first for inter-character timeout on input, second
one for write timeout, and several more "global" ones like
the "link idle" timeout etc.

Modelling an approach of Harvest (or Squid) seems to be a bit
of overkill (or is it the only way to go?).  I tried to use select() for
read/write operations, and ualarm() for "bigger" ones,
but the mix won't work (SIGALRM breaks select(), sure...)
Or shall I drop select() and use ualarm() and longjmp()?

What I badly need is a pointer to some really well-done implementation
(I'll look at userland PPP now, maybe other ones?) of a similar
purpose, to use as a reference.  And yes, as soon as I'll implement 
this successfully, I'll most probably will make this thingy available
under BSD-style license, maybe someone will include this in the
distribution or as a port, at least. :)

-- 
Best regards,
Andrew Stesin

nic-hdl: ST73-RIPE



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9811082307300.11274-100000>