public class NAKACK extends Protocol
Once a mode is set, it remains in effect until exactly 1 message has been sent, afterwards the default mode NAK is used again.
The following communication between 2 peers exists (left side is initiator, right side receiver):send_out_of_band --------------> synchronous (1) <------------- ack send_nak --------------> asynchronous (2) send_nak_ack --------------> synchronous (3) <-------------- ack retransmit <-------------- asynchronous (4)When a message is sent, it will contain a header describing the type of the message, and containing additional data, such as sequence number etc. When a message is received, it is fed into either the OutOfBander or NAKer, depending on the header's type.
Note that in the synchronous modes, ACKs are sent for each request. If a reliable unicast protocol layer exists somewhere underneath this layer, then even the ACKs are transmitted reliably, thus increasing the number of messages exchanged. However, since it is envisaged that ACK/OUT_OF_BAND are not used frequently, this problem is currently not addressed.
down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio
Constructor and Description |
---|
NAKACK() |
Modifier and Type | Method and Description |
---|---|
void |
down(Event evt)
Callback.
|
java.lang.String |
getName() |
void |
init()
Do some initial tasks
|
java.util.Vector |
providedDownServices()
List of events that are provided to layers below (they will be handled when sent down from
below).
|
java.util.Vector |
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from
above).
|
boolean |
setProperties(java.util.Properties props)
Configures the protocol initially.
|
void |
stop()
This method is called on a
Channel.disconnect() . |
void |
up(Event evt)
Callback.
|
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, passDown, passUp, printStats, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, start, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled
public void init() throws java.lang.Exception
public void stop()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedpublic java.util.Vector providedUpServices()
Protocol
providedUpServices
in class Protocol
public java.util.Vector providedDownServices()
Protocol
providedDownServices
in class Protocol
public void up(Event evt)
Do not use passUp()
in this method as the event is passed up
by default by the superclass after this method returns !
public void down(Event evt)
Do not use passDown
in this method as the event is passed down
by default by the superclass after this method returns !
public boolean setProperties(java.util.Properties props)
Protocol
"loopback=false;unicast_inport=4444"
setProperties
in class Protocol
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.