01: // SocketClientState.java
02: // $Id: SocketClientState.java,v 1.5 2004/02/10 13:16:39 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.http.socket;
07:
08: import org.w3c.util.LRUAble;
09:
10: public class SocketClientState implements LRUAble {
11: static final int C_IDLE = 0; // Zombie
12: static final int C_BUSY = 1; // Is in busy list
13: static final int C_FREE = 2; // Is in free list
14: static final int C_KILL = 3; // Being killed
15: static final int C_FIN = 4;
16: LRUAble next = null;
17: LRUAble prev = null;
18: SocketClient client = null;
19: int id = 0;
20: int status = C_IDLE;
21: boolean bound = false;
22: boolean marked = false;
23:
24: SocketClientState csnext = null;
25: SocketClientState csprev = null;
26:
27: static int nextid = 0;
28:
29: static final synchronized int nextId() {
30: return nextid++;
31: }
32:
33: public final LRUAble getNext() {
34: return next;
35: }
36:
37: public final LRUAble getPrev() {
38: return prev;
39: }
40:
41: public final void setNext(LRUAble next) {
42: this .next = next;
43: }
44:
45: public final void setPrev(LRUAble prev) {
46: this .prev = prev;
47: }
48:
49: SocketClientState(SocketClientState cshead) {
50: this .status = C_IDLE;
51: this .id = nextId();
52: cshead.csprev = this ;
53: this .csnext = cshead;
54: }
55:
56: // Used to create the head of the list.
57: SocketClientState() {
58: }
59:
60: }
|