public class FrameFlusher extends Object
EndPoint.write(Callback, ByteBuffer...)
Constructor and Description |
---|
FrameFlusher(Generator generator,
EndPoint endpoint)
Create a WriteBytesProvider with specified Generator and "flush" Callback.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Force closure of write bytes
|
void |
enqueue(Frame frame,
WriteCallback callback) |
int |
getBufferSize() |
boolean |
isClosed()
Used to test for the final frame possible to be enqueued, the CLOSE frame.
|
protected void |
onFailure(Throwable x) |
void |
setBufferSize(int bufferSize)
Set the buffer size used for generating ByteBuffers from the frames.
|
String |
toString() |
public FrameFlusher(Generator generator, EndPoint endpoint)
generator
- the generator to use for converting Frame
objects to network ByteBuffer
sendpoint
- the endpoint to flush to.public void setBufferSize(int bufferSize)
Value usually obtained from AbstractConnection#getInputBufferSize()
bufferSize
- the buffer size to usepublic int getBufferSize()
public void close()
public boolean isClosed()
public void enqueue(Frame frame, WriteCallback callback)
protected void onFailure(Throwable x)
Copyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.