barrier/CSocket.cpp
crs 900b075e3a initial revision of synergy. currently semi-supports X windows
on unix, but client screens don't simulate events other than
mouse move.  also not supporting clipboard at all yet and the
main app is just a temporary framework to test with.  must
clean up protocol and communication.
2001-05-13 11:40:29 +00:00

59 lines
769 B
C++

#include "CSocket.h"
#include "IJob.h"
//
// CSocket
//
CSocket::CSocket() : m_readJob(NULL), m_writeJob(NULL)
{
// do nothing
}
CSocket::~CSocket()
{
delete m_readJob;
delete m_writeJob;
}
void CSocket::setReadJob(IJob* adoptedJob)
{
delete m_readJob;
m_readJob = adoptedJob;
onJobChanged();
}
void CSocket::setWriteJob(IJob* adoptedJob)
{
delete m_writeJob;
m_writeJob = adoptedJob;
onJobChanged();
}
void CSocket::onJobChanged()
{
// do nothing
}
void CSocket::runReadJob()
{
if (m_readJob)
m_readJob->run();
}
void CSocket::runWriteJob()
{
if (m_writeJob)
m_writeJob->run();
}
bool CSocket::hasReadJob() const
{
return (m_readJob != NULL);
}
bool CSocket::hasWriteJob() const
{
return (m_writeJob != NULL);
}