mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-11 14:27:57 +08:00
moved stream into synergy namespace (to prevent naming collision in win libs)
implemented ipc "hello" message (to identify client type) integ tests working for hello message, but use of ipc in main program has problem with events.
This commit is contained in:
@@ -66,7 +66,7 @@ CClientListener::CClientListener(const CNetworkAddress& address,
|
||||
LOG((CLOG_DEBUG1 "listening for clients"));
|
||||
|
||||
// setup event handler
|
||||
EVENTQUEUE->adoptHandler(IListenSocket::getConnectingEvent(), m_listen,
|
||||
EVENTQUEUE->adoptHandler(m_listen->getConnectingEvent(), m_listen,
|
||||
new TMethodEventJob<CClientListener>(this,
|
||||
&CClientListener::handleClientConnecting));
|
||||
}
|
||||
@@ -95,7 +95,7 @@ CClientListener::~CClientListener()
|
||||
client = getNextClient();
|
||||
}
|
||||
|
||||
EVENTQUEUE->removeHandler(IListenSocket::getConnectingEvent(), m_listen);
|
||||
EVENTQUEUE->removeHandler(m_listen->getConnectingEvent(), m_listen);
|
||||
delete m_listen;
|
||||
delete m_socketFactory;
|
||||
delete m_streamFilterFactory;
|
||||
@@ -131,7 +131,7 @@ void
|
||||
CClientListener::handleClientConnecting(const CEvent&, void*)
|
||||
{
|
||||
// accept client connection
|
||||
IStream* stream = m_listen->accept();
|
||||
synergy::IStream* stream = m_listen->accept();
|
||||
if (stream == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ CEvent::Type CClientProxy::s_disconnectedEvent = CEvent::kUnknown;
|
||||
CEvent::Type CClientProxy::s_clipboardChangedEvent= CEvent::kUnknown;
|
||||
CEvent::Type CClientProxy::s_gameDeviceTimingRecvEvent= CEvent::kUnknown;
|
||||
|
||||
CClientProxy::CClientProxy(const CString& name, IStream* stream) :
|
||||
CClientProxy::CClientProxy(const CString& name, synergy::IStream* stream) :
|
||||
CBaseClientProxy(name),
|
||||
m_stream(stream)
|
||||
{
|
||||
@@ -52,7 +52,7 @@ CClientProxy::close(const char* msg)
|
||||
getStream()->flush();
|
||||
}
|
||||
|
||||
IStream*
|
||||
synergy::IStream*
|
||||
CClientProxy::getStream() const
|
||||
{
|
||||
return m_stream;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "CEvent.h"
|
||||
#include "CString.h"
|
||||
|
||||
class IStream;
|
||||
namespace synergy { class IStream; }
|
||||
|
||||
//! Generic proxy for client
|
||||
class CClientProxy : public CBaseClientProxy {
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
/*!
|
||||
\c name is the name of the client.
|
||||
*/
|
||||
CClientProxy(const CString& name, IStream* adoptedStream);
|
||||
CClientProxy(const CString& name, synergy::IStream* adoptedStream);
|
||||
~CClientProxy();
|
||||
|
||||
//! @name manipulators
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
/*!
|
||||
Returns the stream passed to the c'tor.
|
||||
*/
|
||||
IStream* getStream() const;
|
||||
synergy::IStream* getStream() const;
|
||||
|
||||
//! Get ready event type
|
||||
/*!
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
virtual void gameDeviceTimingReq() = 0;
|
||||
|
||||
private:
|
||||
IStream* m_stream;
|
||||
synergy::IStream* m_stream;
|
||||
|
||||
static CEvent::Type s_readyEvent;
|
||||
static CEvent::Type s_disconnectedEvent;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// CClientProxy1_0
|
||||
//
|
||||
|
||||
CClientProxy1_0::CClientProxy1_0(const CString& name, IStream* stream) :
|
||||
CClientProxy1_0::CClientProxy1_0(const CString& name, synergy::IStream* stream) :
|
||||
CClientProxy(name, stream),
|
||||
m_heartbeatTimer(NULL),
|
||||
m_parser(&CClientProxy1_0::parseHandshakeMessage)
|
||||
|
||||
@@ -28,7 +28,7 @@ class CEventQueueTimer;
|
||||
//! Proxy for client implementing protocol version 1.0
|
||||
class CClientProxy1_0 : public CClientProxy {
|
||||
public:
|
||||
CClientProxy1_0(const CString& name, IStream* adoptedStream);
|
||||
CClientProxy1_0(const CString& name, synergy::IStream* adoptedStream);
|
||||
~CClientProxy1_0();
|
||||
|
||||
// IScreen
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// CClientProxy1_1
|
||||
//
|
||||
|
||||
CClientProxy1_1::CClientProxy1_1(const CString& name, IStream* stream) :
|
||||
CClientProxy1_1::CClientProxy1_1(const CString& name, synergy::IStream* stream) :
|
||||
CClientProxy1_0(name, stream)
|
||||
{
|
||||
// do nothing
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//! Proxy for client implementing protocol version 1.1
|
||||
class CClientProxy1_1 : public CClientProxy1_0 {
|
||||
public:
|
||||
CClientProxy1_1(const CString& name, IStream* adoptedStream);
|
||||
CClientProxy1_1(const CString& name, synergy::IStream* adoptedStream);
|
||||
~CClientProxy1_1();
|
||||
|
||||
// IClient overrides
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// CClientProxy1_1
|
||||
//
|
||||
|
||||
CClientProxy1_2::CClientProxy1_2(const CString& name, IStream* stream) :
|
||||
CClientProxy1_2::CClientProxy1_2(const CString& name, synergy::IStream* stream) :
|
||||
CClientProxy1_1(name, stream)
|
||||
{
|
||||
// do nothing
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//! Proxy for client implementing protocol version 1.2
|
||||
class CClientProxy1_2 : public CClientProxy1_1 {
|
||||
public:
|
||||
CClientProxy1_2(const CString& name, IStream* adoptedStream);
|
||||
CClientProxy1_2(const CString& name, synergy::IStream* adoptedStream);
|
||||
~CClientProxy1_2();
|
||||
|
||||
// IClient overrides
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
// CClientProxy1_3
|
||||
//
|
||||
|
||||
CClientProxy1_3::CClientProxy1_3(const CString& name, IStream* stream) :
|
||||
CClientProxy1_3::CClientProxy1_3(const CString& name, synergy::IStream* stream) :
|
||||
CClientProxy1_2(name, stream),
|
||||
m_keepAliveRate(kKeepAliveRate),
|
||||
m_keepAliveTimer(NULL)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//! Proxy for client implementing protocol version 1.3
|
||||
class CClientProxy1_3 : public CClientProxy1_2 {
|
||||
public:
|
||||
CClientProxy1_3(const CString& name, IStream* adoptedStream);
|
||||
CClientProxy1_3(const CString& name, synergy::IStream* adoptedStream);
|
||||
~CClientProxy1_3();
|
||||
|
||||
// IClient overrides
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// CClientProxy1_4
|
||||
//
|
||||
|
||||
CClientProxy1_4::CClientProxy1_4(const CString& name, IStream* stream, CServer* server) :
|
||||
CClientProxy1_4::CClientProxy1_4(const CString& name, synergy::IStream* stream, CServer* server) :
|
||||
CClientProxy1_3(name, stream), m_server(server)
|
||||
{
|
||||
assert(m_server != NULL);
|
||||
|
||||
@@ -25,7 +25,7 @@ class CServer;
|
||||
//! Proxy for client implementing protocol version 1.4
|
||||
class CClientProxy1_4 : public CClientProxy1_3 {
|
||||
public:
|
||||
CClientProxy1_4(const CString& name, IStream* adoptedStream, CServer* server);
|
||||
CClientProxy1_4(const CString& name, synergy::IStream* adoptedStream, CServer* server);
|
||||
~CClientProxy1_4();
|
||||
|
||||
// IClient overrides
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
CEvent::Type CClientProxyUnknown::s_successEvent = CEvent::kUnknown;
|
||||
CEvent::Type CClientProxyUnknown::s_failureEvent = CEvent::kUnknown;
|
||||
|
||||
CClientProxyUnknown::CClientProxyUnknown(IStream* stream, double timeout, CServer* server) :
|
||||
CClientProxyUnknown::CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server) :
|
||||
m_stream(stream),
|
||||
m_proxy(NULL),
|
||||
m_ready(false),
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
class CClientProxy;
|
||||
class CEventQueueTimer;
|
||||
class IStream;
|
||||
namespace synergy { class IStream; }
|
||||
class CServer;
|
||||
|
||||
class CClientProxyUnknown {
|
||||
public:
|
||||
CClientProxyUnknown(IStream* stream, double timeout, CServer* server);
|
||||
CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server);
|
||||
~CClientProxyUnknown();
|
||||
|
||||
//! @name manipulators
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
void handleReady(const CEvent&, void*);
|
||||
|
||||
private:
|
||||
IStream* m_stream;
|
||||
synergy::IStream* m_stream;
|
||||
CEventQueueTimer* m_timer;
|
||||
CClientProxy* m_proxy;
|
||||
bool m_ready;
|
||||
|
||||
Reference in New Issue
Block a user