Ticket #4 (assigned task)
Implement multi-streaming in SCTP branch
|Reported by:||firefury||Owned by:||firefury|
The XML conversations are currently assigned a unique ID to allow multiple conversations to take place at once. This should be implemented using SCTP multi-streaming. Have to work out how to allocate streams to message IDs. Are message IDs 1-shot or can they be persistent? If they aren't persistent (or maybe even if they are?) we could just do:
stream = msgid % available_streams
Clearly we still need to leave the real message ID in the message.
Need to check that events (such as <say>) from the server get assigned a consistent message ID - these messages need to go into a single stream so they are guaranteed to arrive in-order.
There is some preamble on current messages too which we should deal with for SCTP:
- Command (can be "CMD", "RPY" or "ERR") - We need to parse this so we know what slang functions to execute. Although IMHO it'd be nicer to include this in the XML. Maybe the whole XML message can be wrapped in "<cmd></cmd>", "<rpy></rpy>" and "<err></err>" tags. Another possibility is to add a msgtype="cmd", msgtype="rpy" or msgtype="err" to the root element of the XML.
- Expected message size - we don't need this at all under SCTP since it's a datagram protocol and we're guaranteed to get the whole buffer in a single read.