Alex Bikfalvi
SimStream Documentation
StreamServerPushUcastMulti.h
00001 #pragma once 00002 00003 #include "StreamServer.h" 00004 00005 #include "Address.h" 00006 #include "Timer.h" 00007 #include "StreamBootPushMulti.h" 00008 #include "Shuffle.h" 00009 00010 #include "PacketStream.h" 00011 #include "StreamEncoderFrame.h" 00012 00013 #include "StreamMessage.h" 00014 #include "StreamMessagePushMultiJoin.h" 00015 #include "StreamMessagePushMultiLeave.h" 00016 #include "StreamMessageBootPushMultiRequest.h" 00017 #include "StreamMessageBootPushMultiResponse.h" 00018 #include "StreamMessageBootPushMultiRegister.h" 00019 #include "StreamMessageBootPushMultiDeregister.h" 00020 00021 class CStreamServerPushUcastMulti : public CStreamServer 00022 { 00023 private: 00024 // Stream 00025 CStreamSource* source; 00026 set<CAddress>* receivers; 00027 CTimer<CStreamServerPushUcastMulti>* timer; 00028 00029 // Bootstrap 00030 CStreamBootPushMulti* bootstrap; 00031 00032 // Delegates 00033 IDelegate2<void, CAddress, CPacketStream*>* 00034 delegateSendStream; 00035 IDelegate2<void, CAddress, CStreamMessage*>* 00036 delegateSendMessage; 00037 00038 // Global 00039 __uint32 layers; 00040 00041 __byte gopLength; 00042 00043 __time scheduleTime; 00044 __uint32 scheduleFrame; 00045 __uint32 scheduleRate; 00046 __uint32 deltaFrame; 00047 00048 // Encoder 00049 CStreamEncoderFrame* encoder; 00050 00051 public: 00052 CStreamServerPushUcastMulti( 00053 CSimHandler* sim, 00054 CStreamSource* source, 00055 IDelegate2<void, CAddress, CPacketStream*>* delegateSendStream, 00056 IDelegate2<void, CAddress, CStreamMessage*>* delegateSendMessage, 00057 __uint32 layers, 00058 __byte gopLength 00059 ); 00060 virtual ~CStreamServerPushUcastMulti(); 00061 00062 // Control 00063 void Start(); 00064 void Stop(); 00065 00066 // Receive 00067 void Recv(CAddress src, CStreamMessage* message); 00068 00069 // Finalizer 00070 virtual void Finalize(); 00071 00072 private: 00073 void Timer(CTimerInfo* info); 00074 00075 void RecvMessageQuery(CAddress src, CStreamMessageBootPushMultiRequest* message); 00076 void RecvMessageQueryStream(CAddress src, CStreamMessageBootPushMultiRequest* message); 00077 void RecvMessageQueryLayer(CAddress src, CStreamMessageBootPushMultiRequest* message); 00078 00079 void RecvMessageRegister(CAddress src, CStreamMessageBootPushMultiRegister* message); 00080 void RecvMessageDeregister(CAddress src, CStreamMessageBootPushMultiDeregister* message); 00081 00082 void RecvMessageJoin(CAddress src, CStreamMessagePushMultiJoin* message); 00083 void RecvMessageLeave(CAddress src, CStreamMessagePushMultiLeave* message); 00084 };
Last updated: February 8, 2011