/// <summary> /// Implemented to transfer data on an established connection /// </summary> protected override void TransferData() { //we only ever use the network serializer. NetworkMessage nextPacket = null; do { nextPacket = ReadNetworkMessage(); if (nextPacket != null) { var viewStartCommand = nextPacket as LiveViewStartCommandMessage; var sendSessionCommand = nextPacket as SendSessionCommandMessage; if (viewStartCommand != null) { viewStartCommand.Validate(); //we need to initiate an outbound viewer to the same destination we point to. m_Messenger.StartLiveView(GetOptions(), viewStartCommand.RepositoryId, viewStartCommand.ChannelId, viewStartCommand.SequenceOffset); } else if (sendSessionCommand != null) { //send to server baby! m_Messenger.SendToServer((SendSessionCommandMessage)nextPacket); } } } while (nextPacket != null); //it will go to null when the connection closes }