Annotation of fam/fam/Activity.h, Revision 1.1.1.1
1.1 trev 1: // Copyright (C) 1999 Silicon Graphics, Inc. All Rights Reserved.
2: //
3: // This program is free software; you can redistribute it and/or modify it
4: // under the terms of version 2 of the GNU General Public License as
5: // published by the Free Software Foundation.
6: //
7: // This program is distributed in the hope that it would be useful, but
8: // WITHOUT ANY WARRANTY; without even the implied warranty of
9: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, any
10: // license provided herein, whether implied or otherwise, is limited to
11: // this program in accordance with the express provisions of the GNU
12: // General Public License. Patent licenses, if any, provided herein do not
13: // apply to combinations of this program with other product or programs, or
14: // any other product whatsoever. This program is distributed without any
15: // warranty that the program is delivered free of the rightful claim of any
16: // third person by way of infringement or the like. See the GNU General
17: // Public License for more details.
18: //
19: // You should have received a copy of the GNU General Public License along
20: // with this program; if not, write the Free Software Foundation, Inc., 59
21: // Temple Place - Suite 330, Boston MA 02111-1307, USA.
22:
23: #ifndef Activity_included
24: #define Activity_included
25:
26: // The Activity class is used to keep track of when fam is doing
27: // something worthwhile, and when it isn't. Currently, the only
28: // worthwhile activity is talking to (non-internal) clients. So an
29: // Activity is enclosed in each TCP_Client. When the last Activity
30: // is destroyed, a death timer is started. When the death timer
31: // expires, fam expires too.
32: //
33: // The duration of the timer can be set (timeout()), but there is
34: // no other public interface to Activity.
35:
36: class Activity {
37:
38: public:
39:
40: enum { default_timeout = 5 }; // five seconds
41:
42: Activity();
43: Activity(const Activity&);
44: ~Activity();
45:
46: static void timeout(unsigned t) { idle_time = t; }
47:
48: private:
49:
50: static void task(void *);
51:
52: static unsigned count;
53: static unsigned idle_time;
54:
55: };
56:
57: #endif /* !Activity_included */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>