|
The Kiwi Reliable Delivery Protocol (KRDP)
|
Previous Top Next |
|
|
| 00 = SenderID
|
| 01 = ReceiverResponse
|
| 02 = Sequenced message
|
| 03 = Message acknowledgement
|
| 04 = Receiver KeepAlive
|
| 99 = Error message
|
| KRDP AA 0000000000 Message<CR>
|
|
|
| KRDP = Unique tag
|
| Space (ASCII 32)
|
| AA = Msg type (as above)
|
| Space (ASCII 32)
|
| 0000000000 = Sequence number 0 to 2147483647
|
| Space (ASCII 32)
|
| Message = UTF-8 encoded message text
|
| <CR> = Carriage return character ASCII 13 to indicate end of message stream
|
| S connects via TCP
|
| S sends first ID packet (MsgType 00)
|
| R responds with ReceiverResponse message (MsgType 01)
|
| S sends sequenced messages (MsgType 02)
|
| 1. | If the first message R receives is not a ID message (MsgType 00), R disconnects. (Any data received is ignored).
|
| 2. | If R does not receive ID message after 60 seconds, R disconnects.
|
| 3. | After S sends the ID message, S will wait up to 60 seconds for a ReceiverResponse message. If there is no response, S will disconnect session.
|
| 4. | R sends ACK messages to S with the next expected message sequence
|
| 5. | ACK messages are sent no more frequently than once every 200ms
|
| KRDP 00 PV UniqueKey<CR>
|
| The unique key identifies the channel and is used to synchronise the message numbers
|
| PV = Protocol Version to use. 01 = KRDP Reliable/Acknowledged
|
| Unique key format is free form.
|
| An example would be: "IP=192.168.1.1, Host=myhost.com, ID=Instance1"
|
| Or, just: "Instance1"
|
| Since the receiver might already have an "Instance1" name from another source, the first UniqueKey would be better. Use as much information to uniquely describe the source of the messages
|
| KRDP 01 0000000000 Listener ID<CR>
|
| Message number is 10 digit number 0000000000 to 2147483647
|
| KRDP 02 0000000000 Message content<CR>
|
| Message number is 10 digit number 0000000000 to 2147483647
|
| KRDP 03 0000000000 ACK<CR>
|
| Message number is 10 digit number 0000000000 to 2147483647
|
| Message number indicates the next sequence number it expects to receive
|
| ACK messages are sent at a maximum rate of once every 200ms
|
| KRDP 04 0000000000 KeepAlive<CR>
|
| Message number is 10 digit number 0000000000 to 2147483647
|
| Message number = Next expected message number
|
| If being sent by Sender, MsgSeq should be set to 0
|
| If being sent by Receiver, MsgSeq should be set to next expected message number
|
| KRDP 99 0000000000 0000 Error message here<CR>
|
| Message number is 10 digit number 0000000000 to 2147483647
|
| Message number indicates which message caused the error if any. Set to zero (0) if not related to a message number
|
| 0000 = Error number (0000 to 9999)
|
| Error message can be any text
|