public class AUTOCONF extends Protocol
This protocol should be placed above the transport protocol (e.g. UDP). It is not needed for TCP.
Example: senses the network send and receive buffers, plus the max size of a message to be sent and generates a CONFIG event containing "frag_size", "send_buf_size" and "receive_buf_size" keys.
| Constructor and Description |
|---|
AUTOCONF() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
static void |
main(java.lang.String[] args) |
int |
senseMaxFragSize()
Tries to find out the max number of bytes in a DatagramPacket we can send by sending increasingly
larger packets, until there is an exception (e.g., java.io.IOException: message too long).
|
static int |
senseMaxFragSizeStatic() |
boolean |
setProperties(java.util.Properties props)
Setup the Protocol instance acording to the configuration string
|
void |
start()
This method is called on a
Channel.connect(String). |
destroy, down, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getProperties, getProtocolStack, getThreadFactory, getTransport, getUpProtocol, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, stop, up, upThreadEnabledpublic void init()
throws java.lang.Exception
Protocolpublic void start()
throws java.lang.Exception
ProtocolChannel.connect(String). Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start in class Protocoljava.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String) will throw an exceptionpublic boolean setProperties(java.util.Properties props)
setProperties in class Protocolpublic static int senseMaxFragSizeStatic()
public int senseMaxFragSize()
public static void main(java.lang.String[] args)
Copyright ? 1998-2008 Bela Ban. All Rights Reserved.