From owner-freebsd-questions Sun Nov 8 13:26:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA23598 for freebsd-questions-outgoing; Sun, 8 Nov 1998 13:26:26 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from trifork.gu.net (trifork.gu.net [194.93.191.246]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA23555; Sun, 8 Nov 1998 13:26:18 -0800 (PST) (envelope-from fbsd@trifork.gu.net) Received: from localhost (localhost.gu.net [127.0.0.1]) by trifork.gu.net (8.9.1/8.9.1) with ESMTP id AAA11419; Mon, 9 Nov 1998 00:28:01 +0303 (UST) (envelope-from fbsd@trifork.gu.net) Date: Sun, 8 Nov 1998 23:25:57 +0200 (EET) From: Andrew Stesin Reply-To: fbsd@trifork.gu.net To: hackers@FreeBSD.ORG, questions@FreeBSD.ORG Subject: Semi-realtime programming Q (RS-232, timers) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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