00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CCLIENTPROXYUNKNOWN_H
00020 #define CCLIENTPROXYUNKNOWN_H
00021
00022 #include "CEvent.h"
00023
00024 class CClientProxy;
00025 class CEventQueueTimer;
00026 namespace synergy { class IStream; }
00027 class CServer;
00028
00029 class CClientProxyUnknown {
00030 public:
00031 CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server);
00032 ~CClientProxyUnknown();
00033
00035
00036
00038
00043 CClientProxy* orphanClientProxy();
00044
00046
00047
00048
00050
00054 static CEvent::Type getSuccessEvent();
00055
00057
00061 static CEvent::Type getFailureEvent();
00062
00064
00065 private:
00066 void sendSuccess();
00067 void sendFailure();
00068 void addStreamHandlers();
00069 void addProxyHandlers();
00070 void removeHandlers();
00071 void removeTimer();
00072 void handleData(const CEvent&, void*);
00073 void handleWriteError(const CEvent&, void*);
00074 void handleTimeout(const CEvent&, void*);
00075 void handleDisconnect(const CEvent&, void*);
00076 void handleReady(const CEvent&, void*);
00077
00078 private:
00079 synergy::IStream* m_stream;
00080 CEventQueueTimer* m_timer;
00081 CClientProxy* m_proxy;
00082 bool m_ready;
00083
00084 static CEvent::Type s_successEvent;
00085 static CEvent::Type s_failureEvent;
00086 CServer* m_server;
00087 };
00088
00089 #endif