Alex Bikfalvi
SimStream Documentation
HostClient.h
00001 #pragma once 00002 00003 #include "Host.h" 00004 #include "StreamClient.h" 00005 00006 class CHostClient : public CHost 00007 { 00008 public: 00009 enum EState 00010 { 00011 STATE_OFF = 0, 00012 STATE_ON_IDLE = 1, 00013 STATE_ON_WATCHING = 2 00014 }; 00015 00016 protected: 00017 // Session 00018 EState state; 00019 CChannel* channel; 00020 00021 __time sessionTimeStart; 00022 __time sessionTimeFinish; 00023 00024 // Stream 00025 CStreamClient* streamClient; 00026 00027 // Stat 00028 __uint32 statFramesRecv; 00029 __uint32 statFramesDiscarded; 00030 __uint32 statFramesExpected; 00031 00032 public: 00033 CHostClient( 00034 __uint32 id, 00035 CSimHandler* sim, 00036 CAddress address, 00037 CInfo* info, 00038 CData* data, 00039 __bitrate bw 00040 ); 00041 virtual ~CHostClient(); 00042 00043 void EventArrive(); 00044 void EventLeave(); 00045 void EventWatch(CChannel* channel, __time duration); 00046 00047 virtual void Finalize(); 00048 00049 inline __uint32 StatFramesRecv() { return this->statFramesRecv; } 00050 inline __uint32 StatFramesDiscarded() { return this->statFramesDiscarded; } 00051 inline __uint32 StatFramesExpected() { return this->statFramesExpected; } 00052 00053 protected: 00054 void ChannelConnect(CChannel* channel); 00055 void ChannelDisconnect(); 00056 void ChannelSwitch(CChannel* channel); 00057 00058 virtual void ChannelConnectUcast(CChannel* channel) = 0; 00059 virtual void ChannelDisconnectUcast() = 0; 00060 00061 virtual void ChannelConnectMcast(CChannel* channel) = 0; 00062 virtual void ChannelDisconnectMcast() = 0; 00063 };
Last updated: February 8, 2011