H::SocketClient Class Reference

Main SocketClient class. More...

#include <SocketClient.hpp>

Inheritance diagram for H::SocketClient:

Inheritance graph
[legend]
Collaboration diagram for H::SocketClient:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void connectToServer (std::string Host, int Port)
 Connect to a server.
bool isClientConnected ()
 Are we connected to the server.
virtual void onSocketClientConnect (Socket const &socket)
 Event triggered on a socket connection.
virtual void onSocketClientDisconnect (Socket const &socket)
 Event triggered on a socket read.
virtual void onSocketClientMessage (Socket const &socket, std::string const &Message)
 Event triggered on a socket message.
virtual void onSocketClientRead (Socket const &socket, DynamicBuffer< char > &ReadBuffer)
 Event triggered on a socket read.
void sendToServer (std::string const &Message)
 Send a message to the server.
 SocketClient ()
 Default Constructor.
virtual ~SocketClient ()
 Destructor.


Detailed Description

Main SocketClient class.

This is an interface for classes wishing to receive socket events

Definition at line 60 of file SocketClient.hpp.


Member Function Documentation

void SocketClient::connectToServer ( std::string  Host,
int  Port 
)

Connect to a server.

Parameters:
Host Hostname of the server to connect to
Port Port of the server to connect to

Definition at line 67 of file SocketClient.cpp.

References H::Socket::connect(), H::Socket::createSocket(), H::SOCKET_INTERNET, and H::SOCKET_STREAM.

Referenced by GizmodLibVisualPlugin::init().

bool SocketClient::isClientConnected (  ) 

Are we connected to the server.

Are we connected to the server?

Returns:
True if yes

Definition at line 76 of file SocketClient.cpp.

Referenced by Gizmod::GizmoClient::sendEventATIX10(), Gizmod::GizmoClient::sendEventCPUUsage(), Gizmod::GizmoClient::sendEventLIRC(), Gizmod::GizmoClient::sendEventPowermate(), Gizmod::GizmoClient::sendEventSoundCard(), Gizmod::GizmoClient::sendEventSoundVisualization(), Gizmod::GizmoClient::sendEventStandard(), and Gizmod::GizmoClient::sendEventWindowFocus().

void SocketClient::onSocketClientConnect ( Socket const &  socket  )  [virtual]

Event triggered on a socket connection.

Event triggered on socket connect.

Parameters:
socket The socket

Definition at line 84 of file SocketClient.cpp.

References cdbg.

void SocketClient::onSocketClientDisconnect ( Socket const &  socket  )  [virtual]

Event triggered on a socket read.

Event triggered on socket disconnect.

Parameters:
socket The socket

Definition at line 93 of file SocketClient.cpp.

References cdbg.

void SocketClient::onSocketClientMessage ( Socket const &  socket,
std::string const &  Message 
) [virtual]

Event triggered on a socket message.

Event triggered on a socket client message.

Parameters:
socket The Socket that triggered the event
Message The message

Definition at line 103 of file SocketClient.cpp.

References cdbg.

void SocketClient::onSocketClientRead ( Socket const &  socket,
DynamicBuffer< char > &  ReadBuffer 
) [virtual]

Event triggered on a socket read.

Event triggered on socket read.

Parameters:
socket The socket
ReadBuffer The data

Definition at line 113 of file SocketClient.cpp.

References cdbg, and H::DynamicBuffer< DataType >::length().

void SocketClient::sendToServer ( std::string const &  Message  ) 

Send a message to the server.

Send a formatted message to the server.

Parameters:
Message The message to send

Definition at line 167 of file SocketClient.cpp.

References H::Socket::writeMessage().

Referenced by Gizmod::GizmoClient::sendEventATIX10(), Gizmod::GizmoClient::sendEventCPUUsage(), Gizmod::GizmoClient::sendEventLIRC(), Gizmod::GizmoClient::sendEventPowermate(), Gizmod::GizmoClient::sendEventSoundCard(), Gizmod::GizmoClient::sendEventSoundVisualization(), Gizmod::GizmoClient::sendEventStandard(), and Gizmod::GizmoClient::sendEventWindowFocus().


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 10:07:18 2007 for gizmod by  doxygen 1.5.3