|
35 | 35 | * text frames, and receiving frames through an event-based model. |
36 | 36 | */ |
37 | 37 | public class WebSocketImpl implements WebSocket { |
38 | | - |
39 | | - public static final List<Draft> defaultdraftlist = new ArrayList<Draft>( 1 ); |
40 | 38 | public static int RCVBUF = 16384; |
41 | | - public static/*final*/ boolean DEBUG = false; // must be final in the future in order to take advantage of VM optimization |
42 | 39 |
|
43 | | - static { |
44 | | - defaultdraftlist.add( new Draft_6455() ); |
45 | | - } |
| 40 | + /** |
| 41 | + * Activate debug mode for additional infos |
| 42 | + */ |
| 43 | + public static boolean DEBUG = false; // must be final in the future in order to take advantage of VM optimization |
46 | 44 |
|
47 | 45 | /** |
48 | 46 | * Queue of buffers that need to be sent to the client. |
@@ -70,12 +68,25 @@ public class WebSocketImpl implements WebSocket { |
70 | 68 | */ |
71 | 69 | private volatile boolean flushandclosestate = false; |
72 | 70 | private READYSTATE readystate = READYSTATE.NOT_YET_CONNECTED; |
| 71 | + |
| 72 | + /** |
| 73 | + * A list of drafts available for this websocket |
| 74 | + */ |
73 | 75 | private List<Draft> knownDrafts; |
74 | 76 |
|
| 77 | + /** |
| 78 | + * The draft which is used by this websocket |
| 79 | + */ |
75 | 80 | private Draft draft = null; |
76 | 81 |
|
| 82 | + /** |
| 83 | + * The role which this websocket takes in the connection |
| 84 | + */ |
77 | 85 | private Role role; |
78 | 86 |
|
| 87 | + /** |
| 88 | + * The frame which had the opcode Continous set |
| 89 | + */ |
79 | 90 | private Framedata current_continuous_frame = null; |
80 | 91 |
|
81 | 92 | /** |
@@ -110,7 +121,8 @@ public WebSocketImpl( WebSocketListener listener, List<Draft> drafts ) { |
110 | 121 | this.role = Role.SERVER; |
111 | 122 | // draft.copyInstance will be called when the draft is first needed |
112 | 123 | if( drafts == null || drafts.isEmpty() ) { |
113 | | - knownDrafts = defaultdraftlist; |
| 124 | + knownDrafts = new ArrayList<Draft>(); |
| 125 | + knownDrafts.add(new Draft_6455()); |
114 | 126 | } else { |
115 | 127 | knownDrafts = drafts; |
116 | 128 | } |
|
0 commit comments