01: /*
02: * Copyright (c) 2000 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.sandStorm.lib.aSocket;
26:
27: /**
28: * Internal constants used by the aSocket implementation.
29: */
30: public interface aSocketConst {
31:
32: /** The size of the internal read buffer in bytes */
33: public static final int READ_BUFFER_SIZE = 16384;
34: /** Indicates whether the reader should copy data into a new buffer */
35: public static final boolean READ_BUFFER_COPY = true;
36: /** Number of times to try to finish a socket write */
37: public static final int TRYWRITE_SPIN = 10;
38: /** Maximum number of bytes to try writing at once; -1 if no limit */
39: public static final int MAX_WRITE_LEN = -1;
40: /** Maximum number of write reqs on a socket to process at once */
41: public static final int MAX_WRITE_REQS_PER_SOCKET = 1000;
42: /** Maximum number of writes to process at once */
43: public static final int MAX_WRITES_AT_ONCE = -1;
44: /** Maximum number of accepts to process at once */
45: public static final int MAX_ACCEPTS_AT_ONCE = 1000;
46: /**
47: * Number of empty writes after which write-ready mask is disabled.
48: * If set to -1, no disable will occur.
49: */
50: public static final int WRITE_MASK_DISABLE_THRESHOLD = 10;
51:
52: /** Time in ms to sleep waiting for select */
53: public static final int SELECT_TIMEOUT = 1000;
54: /** Number of times to spin on select */
55: public static final int SELECT_SPIN = 1;
56: /** Time in ms to sleep waiting on event queue */
57: public static final int EVENT_QUEUE_TIMEOUT = 1000;
58: /** Number of times to spin on event queue */
59: public static final int EVENT_QUEUE_SPIN = 10;
60:
61: /** Maximum aggregation constant for aSocketRCTM. */
62: public static final int LARGE_AGGREGATION = 4096;
63: /** Number of measurements to use when adjusting rate in aSocketRCTM. */
64: public static final int MEASUREMENT_SIZE = 200;
65:
66: public static final String READSTAGE_NAME = "aSocket ReadStage";
67: public static final String WRITESTAGE_NAME = "aSocket WriteStage";
68: public static final String LISTENSTAGE_NAME = "aSocket ListenStage";
69:
70: }
|