Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

CConcreteConnection Class Reference

CConcreteConnection class encapsulates the real socket in the server side. More...

#include <concreteconnection.h>


Public Types

enum  TConnectionFailure { ENoSocket = 67000, ESocketClosed, EBadMessage }
enum  TInitError { ENullSocket = 68000, ENullSocketServ }

Public Member Functions

CServerSessionGetSession ()
 ~CConcreteConnection ()
TBool IsListening ()
void ReceiveL (const RMessage &aMessage)
void CancelReceive ()
void Close (TBool aImmediately=EFalse)
 Closes the wrapped socket.

void SendL (TDesC8 *aBuf)
void ListenL (const RMessage &aMessage)
void CancelListen ()

Static Public Member Functions

CConcreteConnectionNewL (RSocket *aSocket, CServerSession &aSession)
CConcreteConnectionNewListeningL (RSocket *aSocket, RSocketServ *aSocketServ, CServerSession &aSession)

Private Member Functions

 CConcreteConnection (RSocket *aSocket, RSocketServ *aSocketServ, CServerSession &aSession)
void ConstructL (TBool aIsListening)
RSocket & GetSocket ()
RSocketServ & GetSocketServ ()

Private Attributes

TBool iIsListening
TBool iIsClosed
CServerSessioniSession
RSocket * iSocket
RSocketServ * iSocketServ
CAsynchSendiSender
CAsynchListeniListener
CAsynchReceiveiReceiver


Detailed Description

CConcreteConnection class encapsulates the real socket in the server side.

CConcreteConnection is a facade to the classes that actually manage the socket (CAsynchSend, CAsynchReceive, CASynchListen).

Author:
Matti Dahlbom

Matti Kokkola

Version:
beta0_7_2003-12-08, 1.14

Definition at line 48 of file concreteconnection.h.


Member Enumeration Documentation

enum CConcreteConnection::TConnectionFailure
 

Enumeration values:
ENoSocket 
ESocketClosed 
EBadMessage 

Definition at line 51 of file concreteconnection.h.

enum CConcreteConnection::TInitError
 

Enumeration values:
ENullSocket 
ENullSocketServ 

Definition at line 57 of file concreteconnection.h.


Constructor & Destructor Documentation

CConcreteConnection::~CConcreteConnection  ) 
 

Definition at line 73 of file concreteconnection.cpp.

References Close(), CServerSession::DeallocateConnection(), iIsListening, iSession, and iSocketServ.

CConcreteConnection::CConcreteConnection RSocket *  aSocket,
RSocketServ *  aSocketServ,
CServerSession aSession
[private]
 

Definition at line 63 of file concreteconnection.cpp.

Referenced by NewL(), and NewListeningL().


Member Function Documentation

void CConcreteConnection::CancelListen  ) 
 

Definition at line 200 of file concreteconnection.cpp.

References iListener.

void CConcreteConnection::CancelReceive  ) 
 

Definition at line 205 of file concreteconnection.cpp.

References iReceiver.

Referenced by CServerSession::CancelReceive().

void CConcreteConnection::Close TBool  aImmediately = EFalse  ) 
 

Closes the wrapped socket.

This operation is synchronous.

Parameters:
aImmediately whether to close the socket immediately (ETrue) or to wait until send/receive has completed.

Definition at line 154 of file concreteconnection.cpp.

References iIsClosed, iIsListening, iListener, iReceiver, iSender, iSocket, and Log::Print().

Referenced by CServerSession::CloseSocket(), CAsynchSend::RunError(), ~CConcreteConnection(), and CServerSession::~CServerSession().

void CConcreteConnection::ConstructL TBool  aIsListening  )  [private]
 

Definition at line 89 of file concreteconnection.cpp.

References CAsynchListen, CAsynchReceive, CAsynchSend, ENullSocket, iIsListening, iListener, iReceiver, iSender, iSocket, and Log::Print().

Referenced by NewL(), and NewListeningL().

CServerSession& CConcreteConnection::GetSession  )  [inline]
 

Definition at line 69 of file concreteconnection.h.

References iSession.

Referenced by CAsynchListen::RunL().

RSocket& CConcreteConnection::GetSocket  )  [inline, private]
 

Definition at line 94 of file concreteconnection.h.

References iSocket.

Referenced by CAsynchListen::DoCancel(), CAsynchReceive::DoCancel(), CAsynchSend::DoCancel(), CAsynchListen::ListenL(), CAsynchReceive::Receive(), and CAsynchSend::SendL().

RSocketServ& CConcreteConnection::GetSocketServ  )  [inline, private]
 

Definition at line 95 of file concreteconnection.h.

References iSocketServ.

Referenced by CAsynchListen::ListenL().

TBool CConcreteConnection::IsListening  )  [inline]
 

Definition at line 72 of file concreteconnection.h.

References iIsListening.

Referenced by CServerSession::AllocateConnection(), and CServerSession::DeallocateConnection().

void CConcreteConnection::ListenL const RMessage &  aMessage  ) 
 

Definition at line 126 of file concreteconnection.cpp.

References ENoSocket, iListener, iSocket, CAsynchListen::ListenL(), and Log::Print().

Referenced by CServerSession::GetIncomingConnection().

CConcreteConnection * CConcreteConnection::NewL RSocket *  aSocket,
CServerSession aSession
[static]
 

Definition at line 35 of file concreteconnection.cpp.

References CConcreteConnection(), and ConstructL().

Referenced by CAsynchListen::RunL().

CConcreteConnection * CConcreteConnection::NewListeningL RSocket *  aSocket,
RSocketServ *  aSocketServ,
CServerSession aSession
[static]
 

Definition at line 49 of file concreteconnection.cpp.

References CConcreteConnection(), and ConstructL().

Referenced by CBTCommunicator::OpenListeningSocketL().

void CConcreteConnection::ReceiveL const RMessage &  aMessage  ) 
 

Definition at line 140 of file concreteconnection.cpp.

References ESocketClosed, iReceiver, iSocket, Log::Print(), and CAsynchReceive::Receive().

Referenced by CServerSession::Receive().

void CConcreteConnection::SendL TDesC8 *  aBuf  ) 
 

Definition at line 110 of file concreteconnection.cpp.

References ESocketClosed, iSender, iSocket, Log::Print(), and CAsynchSend::SendL().

Referenced by CServerSession::Send().


Friends And Related Function Documentation

friend class CAsynchListen [friend]
 

Definition at line 120 of file concreteconnection.h.

Referenced by ConstructL().

friend class CAsynchReceive [friend]
 

Definition at line 121 of file concreteconnection.h.

Referenced by ConstructL().

friend class CAsynchSend [friend]
 

Definition at line 119 of file concreteconnection.h.

Referenced by ConstructL().


Field Documentation

TBool CConcreteConnection::iIsClosed [private]
 

Definition at line 101 of file concreteconnection.h.

Referenced by Close().

TBool CConcreteConnection::iIsListening [private]
 

Definition at line 98 of file concreteconnection.h.

Referenced by Close(), ConstructL(), IsListening(), and ~CConcreteConnection().

CAsynchListen* CConcreteConnection::iListener [private]
 

Definition at line 114 of file concreteconnection.h.

Referenced by CancelListen(), Close(), ConstructL(), and ListenL().

CAsynchReceive* CConcreteConnection::iReceiver [private]
 

Definition at line 117 of file concreteconnection.h.

Referenced by CancelReceive(), Close(), ConstructL(), and ReceiveL().

CAsynchSend* CConcreteConnection::iSender [private]
 

Definition at line 111 of file concreteconnection.h.

Referenced by Close(), ConstructL(), and SendL().

CServerSession& CConcreteConnection::iSession [private]
 

Definition at line 104 of file concreteconnection.h.

Referenced by GetSession(), and ~CConcreteConnection().

RSocket* CConcreteConnection::iSocket [private]
 

Definition at line 107 of file concreteconnection.h.

Referenced by Close(), ConstructL(), GetSocket(), ListenL(), ReceiveL(), and SendL().

RSocketServ* CConcreteConnection::iSocketServ [private]
 

Definition at line 108 of file concreteconnection.h.

Referenced by GetSocketServ(), and ~CConcreteConnection().


The documentation for this class was generated from the following files:
Generated on Mon Dec 8 10:26:08 2003 for CobainAPIImplementation by doxygen 1.3.5