S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CSIPExSocketWriter Class Reference

#include <SIPExSocketWriter.h>

List of all members.

Public Member Functions

 ~CSIPExSocketWriter ()
void Write (const TDesC8 &aBuffer)

Static Public Member Functions

static CSIPExSocketWriter * NewL (RSocket &aSocket, MSIPExWriterNotifier &aNotifier)
static CSIPExSocketWriter * NewLC (RSocket &aSocket, MSIPExWriterNotifier &aNotifier)

Protected Member Functions

void DoCancel ()
void RunL ()

Private Member Functions

 CSIPExSocketWriter (RSocket &aSocket, MSIPExWriterNotifier &aNotifier)
void ConstructL ()

Private Attributes

MSIPExWriterNotifier & iNotifier
RSocket & iSocket
HBufC8 * iBuffer


Detailed Description

CSIPExSocketWriter Writes data to the connected socket.

Definition at line 29 of file SIPExSocketWriter.h.


Constructor & Destructor Documentation

CSIPExSocketWriter::~CSIPExSocketWriter (   ) 
 

~CSIPExSocketWriter Destructor

Definition at line 70 of file SIPExSocketWriter.cpp.

References iBuffer.

00071     {
00072     Cancel();
00073     delete iBuffer;
00074     }

CSIPExSocketWriter::CSIPExSocketWriter (  RSocket &  aSocket,
MSIPExWriterNotifier &  aNotifier
)  [private]
 

CSIPExSocketWriter Constructor

Parameters:
aSocket The reference to the socket
aNotifier The reference to the writer notifier

Definition at line 55 of file SIPExSocketWriter.cpp.

00058     : CActive(CActive::EPriorityStandard), 
00059       iNotifier( aNotifier ), 
00060       iSocket( aSocket )
00061     {
00062     CActiveScheduler::Add(this);
00063     }


Member Function Documentation

CSIPExSocketWriter * CSIPExSocketWriter::NewL (  RSocket &  aSocket,
MSIPExWriterNotifier &  aNotifier
)  [static]
 

NewL Static constructor

Parameters:
aSocket The reference to the socket
aNotifier The reference to the writer notifier

Definition at line 26 of file SIPExSocketWriter.cpp.

References NewLC().

00029     {
00030     CSIPExSocketWriter* self = NewLC( aSocket, aNotifier );
00031     CleanupStack::Pop(self);
00032     return self;
00033     }

CSIPExSocketWriter * CSIPExSocketWriter::NewLC (  RSocket &  aSocket,
MSIPExWriterNotifier &  aNotifier
)  [static]
 

NewLC Static constructor. On return the instance is left to the CleanupStack.

Parameters:
aSocket The reference to the socket
aNotifier The reference to the writer notifier

Definition at line 40 of file SIPExSocketWriter.cpp.

References CSIPExSocketWriter().

00043     {
00044     CSIPExSocketWriter* self = new (ELeave) CSIPExSocketWriter( aSocket, aNotifier );
00045     CleanupStack::PushL(self);
00046     self->ConstructL();
00047     return self;
00048     }

void CSIPExSocketWriter::Write (  const TDesC8 &  aBuffer  ) 
 

Write Asynchronous function. Starts the asynchronous writing.

Definition at line 124 of file SIPExSocketWriter.cpp.

00125     {
00126     if( iBuffer )
00127         {
00128         delete iBuffer;
00129         iBuffer = NULL;
00130         }
00131 
00132     TRAPD( err, iBuffer = aBuffer.AllocL() );
00133 
00134     if( !IsActive() && err == KErrNone )
00135         {
00136         iSocket.Write( *iBuffer, iStatus );
00137         SetActive();
00138         }
00139     }

void CSIPExSocketWriter::DoCancel (   )  [protected]
 

From CActive

Definition at line 90 of file SIPExSocketWriter.cpp.

References iSocket.

00091     {
00092     iSocket.CancelWrite();
00093     }

void CSIPExSocketWriter::RunL (   )  [protected]
 

From CActive

Definition at line 100 of file SIPExSocketWriter.cpp.

References iBuffer, iNotifier, and MSIPExWriterNotifier::WriteDone().

00101     {
00102     if( iBuffer )
00103         {
00104         delete iBuffer;
00105         iBuffer = NULL;
00106         }
00107 
00108     if( iStatus.Int() == KErrNone )
00109         {
00110         iNotifier.WriteDone();
00111         }
00112     else
00113         {
00114         iNotifier.ErrorInWriting( iStatus.Int() );
00115         }
00116     }

void CSIPExSocketWriter::ConstructL (   )  [private]
 

ConstructL Symbian 2nd phase constructor that might leave

Definition at line 81 of file SIPExSocketWriter.cpp.

00082     {
00083     }


© Nokia 2006

Back to top