Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippSimpleClient Class Reference

Inheritance diagram for ippSimpleClient:

ippEngine ippObject List of all members.

Public Types

enum  STATE { disconnected, trying_to_connect, connected }

Public Member Functions

 ippSimpleClient ()
void Connect (const char *hostname, int port=1294)
 connects the client to the server
STATE GetState () const
 returns the state of the client ( connection-wise)
void Disconnect ()
 disconnect
virtual void HeartBeat ()
 perform a heart-beat on the client
bool ReadyToSend () const
bool NeedToSendClearAllErrors () const
virtual void OnConnectionLost ()
 called when the connection with the server is lost
virtual void OnResponse (ippResponsePtr response)
 called when a response has been received from the server
virtual void OnDaemonResponse (ippResponsePtr response)
virtual void OnErrorResponse (ippResponsePtr response)
virtual void OnUnsollicitedEvent (ippResponsePtr response)
 called when a unsolicited event has been received
virtual void OnComnmandCompleted (int tagNumber)
 called when a complete response has been received from the server
void ClearAllErrors ()
 send a ClearAllError command
bool InErrorState () const
bool SendCommand (ippCommandConstPtr command)
 send a command object
void SendCommand (const char *command_string)
 send a command string.
int NumberOfUncompletedCommandsInQueue ()
 returns the number of uncompleted command in queue

Protected Member Functions

void PerformWrite ()
virtual void ProcessLine (const char *inputline)
virtual void ProcessMisformedLine (const char *inputline)

Friends

class ippSimpleServerTestCase

Member Enumeration Documentation

enum ippSimpleClient::STATE
 

Enumeration values:
disconnected 
trying_to_connect 
connected 

Definition at line 21 of file ippSimpleClient.h.


Constructor & Destructor Documentation

ippSimpleClient::ippSimpleClient  ) 
 

Definition at line 15 of file ippSimpleClient.cpp.


Member Function Documentation

void ippSimpleClient::ClearAllErrors  ) 
 

send a ClearAllError command

Definition at line 303 of file ippSimpleClient.cpp.

References IPP_ASSERT, ippCommand, NeedToSendClearAllErrors(), and SendCommand().

Referenced by ippSimpleServerTestCase::testSimpleServer2(), ippSimpleServerTestCase::testSimpleServerStartSessionEndSession(), and ippClientServerSpyTestCase::testSpy().

void ippSimpleClient::Connect const char *  hostname,
int  port = 1294
 

connects the client to the server

Definition at line 24 of file ippSimpleClient.cpp.

References ippSocket::Close(), ippSocket::Connect(), connected, ippSocket::Create(), disconnected, IPP_ASSERT, and trying_to_connect.

Referenced by ippSimpleServerTestCase::testSimpleServer1(), ippSimpleServerTestCase::testSimpleServer2(), ippSimpleServerTestCase::testSimpleServer3(), ippSimpleServerTestCase::testSimpleServer4(), ippSimpleServerTestCase::testSimpleServer5(), ippSimpleServerTestCase::testSimpleServerReceivingAbortE(), ippSimpleServerTestCase::testSimpleServerReceivingInvalidCommand(), ippSimpleServerTestCase::testSimpleServerStartSessionEndSession(), and ippClientServerSpyTestCase::testSpy().

void ippSimpleClient::Disconnect  ) 
 

disconnect

Definition at line 73 of file ippSimpleClient.cpp.

References ippSocket::Close(), disconnected, ippEngine::LogMessage(), and ippEngine::ProbeConnection().

Referenced by HeartBeat(), OnConnectionLost(), ProcessMisformedLine(), ippSimpleServerTestCase::testSimpleServer1(), and ippClientServerSpyTestCase::testSpy().

ippSimpleClient::STATE ippSimpleClient::GetState  )  const
 

returns the state of the client ( connection-wise)

Definition at line 58 of file ippSimpleClient.cpp.

Referenced by ippSimpleServerTestCase::testSimpleServer1(), ippSimpleServerTestCase::testSimpleServer3(), ippSimpleServerTestCase::testSimpleServer4(), ippSimpleServerTestCase::testSimpleServer5(), ippSimpleServerTestCase::testSimpleServerReceivingAbortE(), ippSimpleServerTestCase::testSimpleServerReceivingInvalidCommand(), ippSimpleServerTestCase::testSimpleServerStartSessionEndSession(), and ippClientServerSpyTestCase::testSpy().

void ippSimpleClient::HeartBeat  )  [virtual]
 

perform a heart-beat on the client

Implements ippEngine.

Definition at line 85 of file ippSimpleClient.cpp.

References ippSocket::CanSendData(), ippSocket::Close(), connected, Disconnect(), disconnected, ippSleep(), ippEngine::PerformRead(), and trying_to_connect.

Referenced by ippSimpleServerTestCase::testSimpleServer1(), ippSimpleServerTestCase::testSimpleServer2(), ippSimpleServerTestCase::testSimpleServer3(), ippSimpleServerTestCase::testSimpleServer4(), ippSimpleServerTestCase::testSimpleServer5(), ippSimpleServerTestCase::testSimpleServerReceivingAbortE(), ippSimpleServerTestCase::testSimpleServerReceivingInvalidCommand(), and ippSimpleServerTestCase::testSimpleServerStartSessionEndSession().

bool ippSimpleClient::InErrorState  )  const
 

returns true if the client is in ErrorState. When a client is in error state . it need to call ClearAllErrors before resuming the normal communication with the server.

Definition at line 75 of file ippSimpleClient.h.

Referenced by ippSimpleServerTestCase::testSimpleServerReceivingAbortE(), ippSimpleServerTestCase::testSimpleServerReceivingInvalidCommand(), and ippSimpleServerTestCase::testSimpleServerStartSessionEndSession().

bool ippSimpleClient::NeedToSendClearAllErrors  )  const
 

one of the last command sent has caused an error, or the Server has raised a error and a ClearAllErrors is required

Definition at line 68 of file ippSimpleClient.cpp.

Referenced by ClearAllErrors(), ippSimpleServerTestCase::testSimpleServer2(), and ippClientServerSpyTestCase::testSpy().

int ippSimpleClient::NumberOfUncompletedCommandsInQueue  ) 
 

returns the number of uncompleted command in queue

Definition at line 311 of file ippSimpleClient.cpp.

Referenced by ippSimpleServerTestCase::testSimpleServerReceivingAbortE().

void ippSimpleClient::OnComnmandCompleted int  tagNumber  )  [virtual]
 

called when a complete response has been received from the server

Definition at line 336 of file ippSimpleClient.cpp.

Referenced by ProcessLine().

void ippSimpleClient::OnConnectionLost  )  [virtual]
 

called when the connection with the server is lost

Reimplemented from ippEngine.

Definition at line 274 of file ippSimpleClient.cpp.

References Disconnect(), and ippEngine::LogMessage().

void ippSimpleClient::OnDaemonResponse ippResponsePtr  response  )  [virtual]
 

Definition at line 320 of file ippSimpleClient.cpp.

Referenced by ProcessLine().

void ippSimpleClient::OnErrorResponse ippResponsePtr  response  )  [virtual]
 

Definition at line 316 of file ippSimpleClient.cpp.

Referenced by ProcessLine().

void ippSimpleClient::OnResponse ippResponsePtr  response  )  [virtual]
 

called when a response has been received from the server

Definition at line 325 of file ippSimpleClient.cpp.

Referenced by ProcessLine().

void ippSimpleClient::OnUnsollicitedEvent ippResponsePtr  response  )  [virtual]
 

called when a unsolicited event has been received

Definition at line 331 of file ippSimpleClient.cpp.

Referenced by ProcessLine().

void ippSimpleClient::PerformWrite  )  [protected]
 

void ippSimpleClient::ProcessLine const char *  inputline  )  [protected, virtual]
 

Implements ippEngine.

Definition at line 118 of file ippSimpleClient.cpp.

References BufferFull, CommandTag, EventTag, ippResponseParser::getErrorMessageString(), ippResponseParser::getParserErr(), ippResponseParser::getTag(), ippResponseParser::getTagType(), IllegalCharacter, IllegalTag, IPP_ASSERT_FAIL, IPP_ASSERT_MSG, IPPSIZE, ippEngine::LogMessage(), NoSpaceAtPos6, OnComnmandCompleted(), OnDaemonResponse(), OnErrorResponse(), OnResponse(), OnUnsollicitedEvent(), ippResponseParser::parseResponse(), ippResponseParser::parseTag(), and ippResponseParser::setInput().

void ippSimpleClient::ProcessMisformedLine const char *  inputline  )  [protected, virtual]
 

Implements ippEngine.

Definition at line 260 of file ippSimpleClient.cpp.

References Disconnect(), and ippEngine::LogMessage().

bool ippSimpleClient::ReadyToSend  )  const
 

returns true if the client is ready to send a command to the server. or false if the client is waiting for a acknowledge from a previous command

Definition at line 63 of file ippSimpleClient.cpp.

References connected.

Referenced by ippSimpleServerTestCase::testSimpleServer1(), ippSimpleServerTestCase::testSimpleServer2(), ippSimpleServerTestCase::testSimpleServerReceivingInvalidCommand(), ippSimpleServerTestCase::testSimpleServerStartSessionEndSession(), and ippClientServerSpyTestCase::testSpy().

void ippSimpleClient::SendCommand const char *  command_string  ) 
 

send a command string.

Definition at line 280 of file ippSimpleClient.cpp.

References IPP_ASSERT, ippEngine::LogMessage(), and ippSocket::Write().

bool ippSimpleClient::SendCommand ippCommandConstPtr  command  ) 
 

send a command object

Definition at line 268 of file ippSimpleClient.cpp.

Referenced by ClearAllErrors(), ippSimpleServerTestCase::testSimpleServer2(), ippSimpleServerTestCase::testSimpleServer3(), ippSimpleServerTestCase::testSimpleServerReceivingAbortE(), ippSimpleServerTestCase::testSimpleServerReceivingInvalidCommand(), ippSimpleServerTestCase::testSimpleServerStartSessionEndSession(), and ippClientServerSpyTestCase::testSpy().


Friends And Related Function Documentation

friend class ippSimpleServerTestCase [friend]
 

Definition at line 91 of file ippSimpleClient.h.


The documentation for this class was generated from the following files:
Generated on Wed Nov 8 00:21:07 2006 for IPPDME by  doxygen 1.4.1