KjClientConn Class Reference

#include <KjClientConn.h>

List of all members.

Public Member Functions

 KjClientConn (KjSslServer *_pServer, pthread_t *_pThread)
 ~KjClientConn ()
void NewClient ()
 Waiting for new client request.
string & ReadMsg ()
 Read message from client.
void WriteMsg (const string &_strMsg)
 Write message to the client.
KjSslConnection * GetConn ()
 Get SSL client connection.
pthread_t & GetThreadId ()
 Get or set connection thread index.
pthread_t * GetThread ()
bool & GetIsConnected ()
bool & GetIsLockNewThread ()
bool & GetCanRead ()

Private Member Functions

bool ChatWithClient ()
 Server chat with client.
void ParseClientRequest (string &_strMsg)
 Parse client request and return server message.
void DeleteEndMsg (string &_strMsg)
 Delete end message from string is message exists.

Private Attributes

KjSslServer * m_pServer
 SSL server connection.
KjSslConnection * m_pSslConn
 Pointer to client connection.
pthread_t m_iThreadId
 Client connection thread index.
pthread_t * m_pThread
 Thread pointer.
bool m_bIsConnected
 Is client connected ?
bool m_bIsLockNewThread
 Lock new thread?
string m_strReadMsg
 Message readed from client.
string m_strWriteMsg
 Message write to the client.
bool m_bCanRead
 Can read message ?


Detailed Description

Definition at line 20 of file KjClientConn.h.


Constructor & Destructor Documentation

KjClientConn::KjClientConn KjSslServer *  _pServer,
pthread_t *  _pThread
 

Definition at line 17 of file KjClientConn.cpp.

References m_bCanRead, m_bIsConnected, m_bIsLockNewThread, m_pServer, m_pSslConn, m_pThread, m_strReadMsg, and m_strWriteMsg.

Referenced by KjServerThread::CreateNewThread().

KjClientConn::~KjClientConn  ) 
 

Definition at line 29 of file KjClientConn.cpp.


Member Function Documentation

bool KjClientConn::ChatWithClient  )  [private]
 

Server chat with client.

Return values:
bool Return false if client disconnected or if some connection error

Definition at line 58 of file KjClientConn.cpp.

References m_pSslConn.

Referenced by NewClient().

void KjClientConn::DeleteEndMsg string &  _strMsg  )  [private]
 

Delete end message from string is message exists.

Parameters:
_strMsg Message

Definition at line 35 of file KjClientConn.cpp.

Referenced by ParseClientRequest().

bool& KjClientConn::GetCanRead  )  [inline]
 

Definition at line 70 of file KjClientConn.h.

References m_bCanRead.

KjSslConnection* KjClientConn::GetConn  )  [inline]
 

Get SSL client connection.

Definition at line 44 of file KjClientConn.h.

References m_pSslConn.

bool& KjClientConn::GetIsConnected  )  [inline]
 

Definition at line 60 of file KjClientConn.h.

References m_bIsConnected.

bool& KjClientConn::GetIsLockNewThread  )  [inline]
 

Definition at line 65 of file KjClientConn.h.

References m_bIsLockNewThread.

pthread_t* KjClientConn::GetThread  )  [inline]
 

Definition at line 55 of file KjClientConn.h.

References m_pThread.

pthread_t& KjClientConn::GetThreadId  )  [inline]
 

Get or set connection thread index.

Definition at line 50 of file KjClientConn.h.

References m_iThreadId.

void KjClientConn::NewClient  ) 
 

Waiting for new client request.

Definition at line 117 of file KjClientConn.cpp.

References ChatWithClient(), m_bIsConnected, m_bIsLockNewThread, m_iThreadId, m_pServer, m_pSslConn, and m_pThread.

Referenced by KjServerThread::NewThread().

void KjClientConn::ParseClientRequest string &  _strMsg  )  [private]
 

Parse client request and return server message.

Parameters:
_strMsg Message from client and return message from server

Definition at line 47 of file KjClientConn.cpp.

References DeleteEndMsg(), m_bCanRead, and m_strReadMsg.

string & KjClientConn::ReadMsg  ) 
 

Read message from client.

Return values:
string Message readed from client

Definition at line 148 of file KjClientConn.cpp.

References m_bCanRead, m_strReadMsg, and m_strWriteMsg.

void KjClientConn::WriteMsg const string &  _strMsg  ) 
 

Write message to the client.

Parameters:
_strMsg Message for writing to the client

Definition at line 158 of file KjClientConn.cpp.

References m_pSslConn, m_strReadMsg, and m_strWriteMsg.


Member Data Documentation

bool KjClientConn::m_bCanRead [private]
 

Can read message ?

Definition at line 30 of file KjClientConn.h.

Referenced by GetCanRead(), KjClientConn(), ParseClientRequest(), and ReadMsg().

bool KjClientConn::m_bIsConnected [private]
 

Is client connected ?

Definition at line 26 of file KjClientConn.h.

Referenced by GetIsConnected(), KjClientConn(), and NewClient().

bool KjClientConn::m_bIsLockNewThread [private]
 

Lock new thread?

Definition at line 27 of file KjClientConn.h.

Referenced by GetIsLockNewThread(), KjClientConn(), and NewClient().

pthread_t KjClientConn::m_iThreadId [private]
 

Client connection thread index.

Definition at line 24 of file KjClientConn.h.

Referenced by GetThreadId(), and NewClient().

KjSslServer* KjClientConn::m_pServer [private]
 

SSL server connection.

Definition at line 22 of file KjClientConn.h.

Referenced by KjClientConn(), and NewClient().

KjSslConnection* KjClientConn::m_pSslConn [private]
 

Pointer to client connection.

Definition at line 23 of file KjClientConn.h.

Referenced by ChatWithClient(), GetConn(), KjClientConn(), NewClient(), and WriteMsg().

pthread_t* KjClientConn::m_pThread [private]
 

Thread pointer.

Definition at line 25 of file KjClientConn.h.

Referenced by GetThread(), KjClientConn(), and NewClient().

string KjClientConn::m_strReadMsg [private]
 

Message readed from client.

Definition at line 28 of file KjClientConn.h.

Referenced by KjClientConn(), ParseClientRequest(), ReadMsg(), and WriteMsg().

string KjClientConn::m_strWriteMsg [private]
 

Message write to the client.

Definition at line 29 of file KjClientConn.h.

Referenced by KjClientConn(), ReadMsg(), and WriteMsg().


The documentation for this class was generated from the following files:
Generated on Tue Jul 24 10:03:07 2007 for KjSslServer by  doxygen 1.4.6