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

RCobainSocket Class Reference

UNIX-like socket. More...

#include <cobain.h>


Public Member Functions

IMPORT_C void SetSocketListener (MSocketListener *aSocketListener)
 Registers a socket listener.

IMPORT_C void SendL (const TDesC8 *aBuffer)
 Asynchronously writes data to the socket.

IMPORT_C void Close (TBool aImmediately=EFalse)
 Closes this socket.

IMPORT_C ~RCobainSocket ()
 Deletes this object.


Private Member Functions

 RCobainSocket (RCobainClientSession &aSession, TInt aId)
void RunL ()
void DoCancel ()
void Receive ()

Private Attributes

TBool iIsClosed
TInt iId
RCobainClientSessioniSession
MSocketListeneriSocketListener
TBuf8< KRecvBufSizeiRecvBuf


Detailed Description

UNIX-like socket.

The underlying network medium is transparent to the user.

Author:
Matti Dahlbom
Version:
beta0_7_2003-12-08, 1.36

Definition at line 92 of file cobain.h.


Constructor & Destructor Documentation

EXPORT_C RCobainSocket::~RCobainSocket  ) 
 

Deletes this object.

Closes the socket if it is still open.

Definition at line 38 of file cobainsocket.cpp.

References Close(), iSocketListener, and CCobainLayer::Log().

RCobainSocket::RCobainSocket RCobainClientSession aSession,
TInt  aId
[private]
 

Definition at line 28 of file cobainsocket.cpp.


Member Function Documentation

EXPORT_C void RCobainSocket::Close TBool  aImmediately = EFalse  ) 
 

Closes this socket.

This is a synchronous operation.

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

Definition at line 61 of file cobainsocket.cpp.

References RCobainClientSession::CloseSocket(), iId, iIsClosed, iSession, and CCobainLayer::Log().

Referenced by RunL(), and ~RCobainSocket().

void RCobainSocket::DoCancel  )  [private]
 

Definition at line 113 of file cobainsocket.cpp.

References CCobainLayer::Log().

void RCobainSocket::Receive  )  [private]
 

Definition at line 99 of file cobainsocket.cpp.

References iId, iRecvBuf, iSession, CCobainLayer::Log(), and RCobainClientSession::Receive().

Referenced by RunL(), and SetSocketListener().

void RCobainSocket::RunL  )  [private]
 

Definition at line 121 of file cobainsocket.cpp.

References Close(), MSocketListener::Data(), iRecvBuf, iSocketListener, CCobainLayer::Log(), Receive(), MSocketListener::SocketDisconnected(), and MSocketListener::SocketError().

EXPORT_C void RCobainSocket::SendL const TDesC8 *  aBuffer  ) 
 

Asynchronously writes data to the socket.

Parameters:
aBuffer Buffer containing the data to write to the socket

Definition at line 49 of file cobainsocket.cpp.

References iId, iIsClosed, iSession, iSocketListener, KErrCobainSocketClosed, RCobainClientSession::Send(), and MSocketListener::SocketError().

EXPORT_C void RCobainSocket::SetSocketListener MSocketListener aSocketListener  ) 
 

Registers a socket listener.

The socket starts receiving data immediately. Upon receiving new data, Data() method of the listener is called.

Parameters:
aDataListener data listener

Definition at line 84 of file cobainsocket.cpp.

References iSocketListener, KErrCobainSocketNullSocketListener, and Receive().


Friends And Related Function Documentation

friend class CConnectionListener [friend]
 

Definition at line 146 of file cobain.h.

friend class CNetworkPeer [friend]
 

Definition at line 144 of file cobain.h.

friend class RCobainClientSession [friend]
 

Definition at line 145 of file cobain.h.


Field Documentation

TInt RCobainSocket::iId [private]
 

Definition at line 133 of file cobain.h.

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

TBool RCobainSocket::iIsClosed [private]
 

Definition at line 130 of file cobain.h.

Referenced by Close(), and SendL().

TBuf8<KRecvBufSize> RCobainSocket::iRecvBuf [private]
 

Definition at line 142 of file cobain.h.

Referenced by Receive(), and RunL().

RCobainClientSession& RCobainSocket::iSession [private]
 

Definition at line 136 of file cobain.h.

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

MSocketListener* RCobainSocket::iSocketListener [private]
 

Definition at line 139 of file cobain.h.

Referenced by RunL(), SendL(), SetSocketListener(), and ~RCobainSocket().


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