Classes | Public Member Functions | Public Attributes

CClient Class Reference

Synergy client. More...

#include <CClient.h>

Inherits IClient, and INode.

Inherited by CMockClient.

List of all members.

Classes

class  CFailInfo

Public Member Functions

 CClient (IEventQueue *eventQueue, const CString &name, const CNetworkAddress &address, ISocketFactory *socketFactory, IStreamFilterFactory *streamFilterFactory, CScreen *screen, const CCryptoOptions &crypto)
virtual void * getEventTarget () const
virtual bool getClipboard (ClipboardID id, IClipboard *) const
virtual void getShape (SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const
virtual void getCursorPos (SInt32 &x, SInt32 &y) const
virtual void enter (SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver)
virtual bool leave ()
virtual void setClipboard (ClipboardID, const IClipboard *)
virtual void grabClipboard (ClipboardID)
virtual void setClipboardDirty (ClipboardID, bool)
virtual void keyDown (KeyID, KeyModifierMask, KeyButton)
virtual void keyRepeat (KeyID, KeyModifierMask, SInt32 count, KeyButton)
virtual void keyUp (KeyID, KeyModifierMask, KeyButton)
virtual void mouseDown (ButtonID)
virtual void mouseUp (ButtonID)
virtual void mouseMove (SInt32 xAbs, SInt32 yAbs)
virtual void mouseRelativeMove (SInt32 xRel, SInt32 yRel)
virtual void mouseWheel (SInt32 xDelta, SInt32 yDelta)
virtual void screensaver (bool activate)
virtual void resetOptions ()
virtual void setOptions (const COptionsList &options)
virtual void gameDeviceButtons (GameDeviceID id, GameDeviceButton buttons)
virtual void gameDeviceSticks (GameDeviceID id, SInt16 x1, SInt16 y1, SInt16 x2, SInt16 y2)
virtual void gameDeviceTriggers (GameDeviceID id, UInt8 t1, UInt8 t2)
virtual void gameDeviceTimingReq ()
virtual CString getName () const
manipulators

void connect ()
 Connect to server.
void disconnect (const char *msg)
 Disconnect.
virtual void handshakeComplete ()
 Notify of handshake complete.
virtual void setDecryptIv (const UInt8 *iv)
 Set crypto IV for decryption.

Public Attributes

bool m_mock

accessors



bool isConnected () const
 Test if connected.
bool isConnecting () const
 Test if connecting.
CNetworkAddress getServerAddress () const
 Get address of server.
static CEvent::Type getConnectedEvent ()
 Get connected event type.
static CEvent::Type getConnectionFailedEvent ()
 Get connection failed event type.
static CEvent::Type getDisconnectedEvent ()
 Get disconnected event type.

Detailed Description

Synergy client.

This class implements the top-level client algorithms for synergy.

Definition at line 42 of file CClient.h.


Constructor & Destructor Documentation

CClient::CClient ( IEventQueue eventQueue,
const CString &  name,
const CNetworkAddress address,
ISocketFactory socketFactory,
IStreamFilterFactory streamFilterFactory,
CScreen screen,
const CCryptoOptions crypto 
)

This client will attempt to connect to the server using name as its name and address as the server's address and factory to create the socket. screen is the local screen.

Definition at line 47 of file CClient.cpp.

References IEventQueue::adoptHandler(), ISecondaryScreen::getGameDeviceFeedbackEvent(), ISecondaryScreen::getGameDeviceTimingRespEvent(), IScreen::getResumeEvent(), and IScreen::getSuspendEvent().


Member Function Documentation

void CClient::connect (  ) 

Connect to server.

Starts an attempt to connect to the server. This is ignored if the client is trying to connect or is already connected.

Definition at line 112 of file CClient.cpp.

References IDataSocket::connect(), IStreamFilterFactory::create(), ISocketFactory::create(), CNetworkAddress::getAddress(), CNetworkAddress::getHostname(), CNetworkAddress::getPort(), CNetworkAddress::resolve(), and XBase::what().

void CClient::disconnect ( const char *  msg  ) 

Disconnect.

Disconnects from the server with an optional error message.

Definition at line 173 of file CClient.cpp.

References getDisconnectedEvent().

CEvent::Type CClient::getConnectedEvent (  )  [static]

Get connected event type.

Returns the connected event type. This is sent when the client has successfully connected to the server.

Definition at line 223 of file CClient.cpp.

Referenced by handshakeComplete().

CEvent::Type CClient::getConnectionFailedEvent (  )  [static]

Get connection failed event type.

Returns the connection failed event type. This is sent when the server fails for some reason. The event data is a CFailInfo*.

Definition at line 230 of file CClient.cpp.

CEvent::Type CClient::getDisconnectedEvent (  )  [static]

Get disconnected event type.

Returns the disconnected event type. This is sent when the client has disconnected from the server (and only after having successfully connected).

Definition at line 237 of file CClient.cpp.

Referenced by disconnect().

CNetworkAddress CClient::getServerAddress (  )  const

Get address of server.

Returns the address of the server the client is connected (or wants to connect) to.

Definition at line 217 of file CClient.cpp.

Referenced by CClientTaskBarReceiver::updateStatus().

void CClient::handshakeComplete (  )  [virtual]

Notify of handshake complete.

Notifies the client that the connection handshake has completed.

Definition at line 189 of file CClient.cpp.

References CScreen::enable(), and getConnectedEvent().

bool CClient::isConnected (  )  const

Test if connected.

Returns true iff the client is successfully connected to the server.

Definition at line 205 of file CClient.cpp.

Referenced by CClientTaskBarReceiver::updateStatus().

bool CClient::isConnecting (  )  const

Test if connecting.

Returns true iff the client is currently attempting to connect to the server.

Definition at line 211 of file CClient.cpp.

Referenced by CClientTaskBarReceiver::updateStatus().


The documentation for this class was generated from the following files: