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