Files
spark/src/DataStreamSuite/PubSub/documentation

Basic TCP:
ITCPConnection implemented by AsyncTCPConnection_APM is the innermost class resposinsble for TCP sends and received. Its used 
on both client and server symmetrically. All the hard async send/receive logic is there.
AsyncTCPConnectionAcceptor_APM opens a port and listens and accepts to connections from the client. It creates the ITCPConnection
on the server.
AsyncTCPConnector_APM connects to the server (above) and creates an ITCPConnection on the client side.

IPubSubServerConnection:
All communication to PubSubServer happens using this. It has 3 main types of calls:
1. send: to asyncronoulsy end data
2. get data: either through a polling call or callback
3. get connection info: through callbacks

The only implementation of the above is PubSubServerManagedTCPConnection
(there used to be an MSMQ one and another wrapped around native code - but neither exists anymore)

PubSubMessages:
PubSubClientMessage is the only messages thats sent from client to pubsubserver. Its serialized on the
client and sent over to the pubsubserver, where uits received ad deserialized

PubSubServer:
PubSubMessageReactor (top level, called from main)
ServerMessageHub : IPubsubMessageHub (just a wrapper so multiple  )
ManagedTCPMessageHub : IPubsubMessageHub (this is what handles each ITCPConnection for eahc connection)


Streams:
PubTableBroker allows publishing of streams through createTable, addRow, deleteRow, changeRow, makeBatchChanges ->
PubTablePublisher:IPubTablePublisher per tag (addRow, deleteRow, changeRow, createTable, batchRemoveAdd)
PubTablePublisher has BlueDataSerializationController:IBlueDataSerializer to serialize the rows to byte[]
BlueDataSerializationController uses a IBlueDataSerializer, which is specialized for the tag (using UniversalSerializer for now)

IBlueDataSerializer has just one function
void serialize (byte op, IBlueRowCollection[] rows, out byte[] serializedData);
the second arg is IBlueRowCollection[] because in case of op = StreamOpCode.multipleRemoveAdd, it has multiple IBlueRowCollection for rem and add
(BlueDataSerializer.serialize's comment has the serialization layout)

For each serializer we have 2 matching deserializers, IPubsubDeserializer (for PubSubservr) and IClientDeserializer (for clients subscribing to streams)
For UniversalSerializer, we have PubsubUniversalDeserializer and ClientUniversalDeserializer