Beispiel #1
0
CClientProxyUnknown::CClientProxyUnknown(IStream* stream, double timeout) :
	m_stream(stream),
	m_proxy(NULL),
	m_ready(false)
{
	EVENTQUEUE->adoptHandler(CEvent::kTimer, this,
							new TMethodEventJob<CClientProxyUnknown>(this,
								&CClientProxyUnknown::handleTimeout, NULL));
	m_timer = EVENTQUEUE->newOneShotTimer(timeout, this);
	addStreamHandlers();

	LOG((CLOG_DEBUG1 "saying hello"));
	CProtocolUtil::writef(m_stream, kMsgHello,
							kProtocolMajorVersion,
							kProtocolMinorVersion);
}
CClientProxyUnknown::CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server, IEventQueue* events) :
	m_stream(stream),
	m_proxy(NULL),
	m_ready(false),
	m_server(server),
	m_events(events)
{
	assert(m_server != NULL);

	m_events->adoptHandler(CEvent::kTimer, this,
							new TMethodEventJob<CClientProxyUnknown>(this,
								&CClientProxyUnknown::handleTimeout, NULL));
	m_timer = m_events->newOneShotTimer(timeout, this);
	addStreamHandlers();

	LOG((CLOG_DEBUG1 "saying hello"));
	CProtocolUtil::writef(m_stream, kMsgHello,
							kProtocolMajorVersion,
							kProtocolMinorVersion);
}