org.eclipse.jetty.websocket
Class WebSocketParser
java.lang.Object
org.eclipse.jetty.websocket.WebSocketParser
public class WebSocketParser
- extends Object
Parser the WebSocket protocol.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STATE_START
public static final int STATE_START
- See Also:
- Constant Field Values
STATE_SENTINEL_DATA
public static final int STATE_SENTINEL_DATA
- See Also:
- Constant Field Values
STATE_LENGTH
public static final int STATE_LENGTH
- See Also:
- Constant Field Values
STATE_DATA
public static final int STATE_DATA
- See Also:
- Constant Field Values
WebSocketParser
public WebSocketParser(WebSocketBuffers buffers,
EndPoint endp,
WebSocketParser.EventHandler handler)
- Parameters:
buffers
- The buffers to use for parsing. Only the Buffers.getBuffer()
is used.
This should be a direct buffer if binary data is mostly used or an indirect buffer if utf-8 data
is mostly used.endp
- handler
-
isBufferEmpty
public boolean isBufferEmpty()
getBuffer
public Buffer getBuffer()
parseNext
public int parseNext()
- Parse to next event.
Parse to the next
WebSocketParser.EventHandler
event or until no more data is
available. Fill data from the EndPoint
only as necessary.
- Returns:
- An indication of progress or otherwise. -1 indicates EOF, 0 indicates
that no bytes were read and no messages parsed. A positive number indicates either
the bytes filled or the messages parsed.
fill
public void fill(Buffer buffer)
Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.