sipxmedialib  Version 3.3
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CNetworkChannel Class Reference

#include <NetworkChannel.h>

Inheritance diagram for CNetworkChannel:
Inheritance graph
[legend]
Collaboration diagram for CNetworkChannel:
Collaboration graph
[legend]

Classes

struct  tagChannelFlags
 

Public Member Functions

 CNetworkChannel (INetDispatch *piNetDispatch=NULL, unsigned short usPort=0)
 
 ~CNetworkChannel (void)
 
virtual bool Initialize (void)
 
virtual bool Open (int iAddressType, int iSocketType, int iProtocol)
 
virtual bool Connect (unsigned char *puchIPAddress=NULL, unsigned short usPortID=0)
 
virtual int Receive (unsigned char *puchBuffer, unsigned long ulRxBytes)
 
virtual void Dispatch (unsigned char *puchBuffer, unsigned long ulBytesRecvd)
 
virtual int Send (unsigned char *puchDataBuffer, unsigned long ulBytesToSend)
 
virtual int getSocketDescriptor (void)
 
virtual int getSocketPort (void)
 
virtual bool Close (void)
 
unsigned int GetSocket (void)
 
unsigned short GetPort (void)
 
bool IsOpened (void)
 
bool IsConnected (void)
 
- Public Member Functions inherited from CBaseClass
CBaseClass CBASECLASS_PROTO_ARGS ((const char *pDerivedType="Unknown", int callLineNum=0))
 
virtual ~CBaseClass (void)
 
bool IsInitialized (void)
 
void setAutomatic (bool)
 
virtual unsigned long AddRef ADD_RELEASE_PROTO_ARGS ((int callLineNum))
 
virtual unsigned long Release ADD_RELEASE_PROTO_ARGS ((int callLineNum))
 

Private Member Functions

virtual bool Bind (SOCKADDR_IN *lpAddr=NULL)
 
void GetRemoteAddress (SOCKADDR_IN *lpAddr)
 
void SetRemoteAddress (SOCKADDR_IN *lpAddr)
 

Static Private Member Functions

static unsigned short GetNewPort (void)
 

Private Attributes

CRITICAL_SECTION m_csChannelSynchronized
 
INetDispatch * m_piNetDispatch
 
int m_hSocket
 
SOCKADDR_IN m_ipLocal
 
SOCKADDR_IN m_ipRemote
 
struct CNetworkChannel::tagChannelFlags m_fFlags
 

Additional Inherited Members

- Static Public Member Functions inherited from CBaseClass
static bool AllowDeletes (void)
 
static void s_SetAllowDeletes (int v)
 
- Public Attributes inherited from CBaseClass
bool m_bInitialized
 
bool m_bAutomatic
 
int m_ulReferences
 
- Static Public Attributes inherited from CBaseClass
static bool s_bAllowDeletes = true
 

Constructor & Destructor Documentation

CNetworkChannel ( INetDispatch *  piNetDispatch = NULL,
unsigned short  usPort = 0 
)
~CNetworkChannel ( void  )

Member Function Documentation

virtual bool Initialize ( void  )
virtual

Method Name: Initialize

Inputs: None

Outputs: None

Returns: bool

Description: Performs runtime initialization that may be failure prone and therefore inappropriate for execution within a constructor.

Usage Notes:

Reimplemented from CBaseClass.

virtual bool Open ( int  iAddressType,
int  iSocketType,
int  iProtocol 
)
virtual
virtual bool Connect ( unsigned char *  puchIPAddress = NULL,
unsigned short  usPortID = 0 
)
virtual
virtual int Receive ( unsigned char *  puchBuffer,
unsigned long  ulRxBytes 
)
virtual
virtual void Dispatch ( unsigned char *  puchBuffer,
unsigned long  ulBytesRecvd 
)
virtual
virtual int Send ( unsigned char *  puchDataBuffer,
unsigned long  ulBytesToSend 
)
virtual
virtual int getSocketDescriptor ( void  )
virtual
virtual int getSocketPort ( void  )
virtual
virtual bool Close ( void  )
virtual
unsigned int GetSocket ( void  )
inline
unsigned short GetPort ( void  )
inline
bool IsOpened ( void  )
inline
bool IsConnected ( void  )
inline
virtual bool Bind ( SOCKADDR_IN *  lpAddr = NULL)
privatevirtual

Macro Name: DECLARE_IBASE_M

Inputs: None

Outputs: None

Returns: None

Description: This implements the IBaseClass functions used and exposed by derived classes.

Usage Notes:

static unsigned short GetNewPort ( void  )
staticprivate
void GetRemoteAddress ( SOCKADDR_IN *  lpAddr)
private
void SetRemoteAddress ( SOCKADDR_IN *  lpAddr)
private

Member Data Documentation

CRITICAL_SECTION m_csChannelSynchronized
private
INetDispatch* m_piNetDispatch
private
int m_hSocket
private
SOCKADDR_IN m_ipLocal
private
SOCKADDR_IN m_ipRemote
private
struct CNetworkChannel::tagChannelFlags m_fFlags
private