com.twistedmatrix.spread
Class Banana
java.lang.Object
|
+--com.twistedmatrix.spread.Banana
- Direct Known Subclasses:
- Broker
- public class Banana
- extends java.lang.Object
The Banana wire protocol - an efficient, asynchronous byte-encoding
for s-expressions.
Constructor Summary |
Banana(StreamPair sp,
boolean isClient)
Create a new instance given a pair of streams. |
Method Summary |
void |
close()
Close the connection. |
static void |
handshake(Banana client,
Banana server)
Do handshake between two instances. |
java.lang.Object |
read()
Read from connection. |
void |
start()
Do profile handshake and start reader thread. |
void |
write(java.lang.Object o)
Write to connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PB
protected static final ByteString PB
NONE
protected static final ByteString NONE
DIALECTS
protected static final ByteString[] DIALECTS
HIGH_BIT_SET
protected static final int HIGH_BIT_SET
LIST
protected static final int LIST
INT
protected static final int INT
STRING
protected static final int STRING
NEG
protected static final int NEG
FLOAT
protected static final int FLOAT
LONGINT
protected static final int LONGINT
LONGNEG
protected static final int LONGNEG
VOCAB
protected static final int VOCAB
vocabulary
protected static java.util.ArrayList vocabulary
in
protected BananaDecoder in
out
protected BananaEncoder out
disconnected
protected boolean disconnected
Banana
public Banana(StreamPair sp,
boolean isClient)
- Create a new instance given a pair of streams.
start
public void start()
- Do profile handshake and start reader thread.
close
public void close()
- Close the connection.
write
public void write(java.lang.Object o)
throws java.io.IOException
- Write to connection.
read
public java.lang.Object read()
throws java.io.IOException,
Banana.ProtocolException
- Read from connection.
handshake
public static void handshake(Banana client,
Banana server)
throws java.io.IOException
- Do handshake between two instances.
Useful for testing.