Implement max-connect facility which makes the server sleep if a
[yazproxy-moved-to-github.git] / include / yazproxy / bw.h
1 /* $Id: bw.h,v 1.5 2006-03-30 10:35:15 adam Exp $
2    Copyright (c) 1998-2006, Index Data.
3
4 This file is part of the yazproxy.
5
6 YAZ proxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with YAZ proxy; see the file LICENSE.  If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.
20  */
21
22 #ifndef YAZPROXY_YAZ_BW_H
23 #define YAZPROXY_YAZ_BW_H
24
25 #include <yaz/yconfig.h>
26
27 class YAZ_EXPORT Yaz_bw {
28  public:
29     Yaz_bw(int sz);
30     ~Yaz_bw();
31     void add_bytes(int m);
32     int get_total();
33  private:
34     long m_sec;   // time of most recent bucket
35     int *m_bucket;
36     int m_ptr;
37     int m_size;
38 };
39 #endif
40
41 /*
42  * Local variables:
43  * c-basic-offset: 4
44  * indent-tabs-mode: nil
45  * End:
46  * vim: shiftwidth=4 tabstop=8 expandtab
47  */
48