org.eclipse.jetty.websocket
Class WebSocketGeneratorRFC6455

java.lang.Object
  extended by org.eclipse.jetty.websocket.WebSocketGeneratorRFC6455
All Implemented Interfaces:
WebSocketGenerator

public class WebSocketGeneratorRFC6455
extends java.lang.Object
implements WebSocketGenerator

WebSocketGenerator. This class generates websocket packets. It is fully synchronized because it is likely that async threads will call the addMessage methods while other threads are flushing the generator.


Constructor Summary
WebSocketGeneratorRFC6455(WebSocketBuffers buffers, EndPoint endp)
           
WebSocketGeneratorRFC6455(WebSocketBuffers buffers, EndPoint endp, MaskGen maskGen)
           
 
Method Summary
 void addFrame(byte flags, byte opcode, byte[] content, int offset, int length)
           
 int flush()
           
 int flushBuffer()
           
 Buffer getBuffer()
           
 boolean isBufferEmpty()
           
 void returnBuffer()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebSocketGeneratorRFC6455

public WebSocketGeneratorRFC6455(WebSocketBuffers buffers,
                                 EndPoint endp)

WebSocketGeneratorRFC6455

public WebSocketGeneratorRFC6455(WebSocketBuffers buffers,
                                 EndPoint endp,
                                 MaskGen maskGen)
Method Detail

getBuffer

public Buffer getBuffer()

addFrame

public void addFrame(byte flags,
                     byte opcode,
                     byte[] content,
                     int offset,
                     int length)
              throws java.io.IOException
Specified by:
addFrame in interface WebSocketGenerator
Throws:
java.io.IOException

flushBuffer

public int flushBuffer()
                throws java.io.IOException
Throws:
java.io.IOException

flush

public int flush()
          throws java.io.IOException
Specified by:
flush in interface WebSocketGenerator
Throws:
java.io.IOException

isBufferEmpty

public boolean isBufferEmpty()
Specified by:
isBufferEmpty in interface WebSocketGenerator

returnBuffer

public void returnBuffer()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2013. All Rights Reserved.