14 #ifndef _INC_NETWORKCHANNEL_H_ 15 #define _INC_NETWORKCHANNEL_H_ 19 #ifdef PINGTEL_OSSOCKET 20 #include "os/OsSocket.h" 25 #elif defined(_VXWORKS) 28 typedef struct sockaddr_in SOCKADDR_IN;
29 #define SOCKET_ERROR ERROR 30 #elif defined(__pingtel_on_posix__) 32 #include <netinet/in.h> 33 #include <sys/types.h> 34 #include <sys/socket.h> 35 #include <arpa/inet.h> 36 typedef struct sockaddr_in SOCKADDR_IN;
37 typedef struct sockaddr SOCKADDR;
38 #define SOCKET_ERROR (-1) 40 #error Unsupported target platform. 53 public INetworkSource,
60 #ifndef PINGTEL_OSSOCKET 71 CNetworkChannel(INetDispatch *piNetDispatch=NULL,
unsigned short usPort=0);
121 virtual bool Open(
int iAddressType,
int iSocketType,
int iProtocol);
133 virtual bool Connect(
unsigned char *puchIPAddress=NULL,
134 unsigned short usPortID=0);
145 virtual int Receive(
unsigned char * puchBuffer,
unsigned long ulRxBytes);
155 virtual void Dispatch(
unsigned char * puchBuffer,
156 unsigned long ulBytesRecvd);
169 virtual int Send(
unsigned char * puchDataBuffer,
181 virtual bool Close(
void);
255 virtual bool Bind(SOCKADDR_IN *lpAddr=NULL);
319 #ifdef PINGTEL_OSSOCKET 322 OsSocket & m_rOsSocket;
Definition: NetworkChannel.h:52
unsigned short bfBound
Definition: NetworkChannel.h:310
unsigned short GetPort(void)
Definition: NetworkChannel.h:202
virtual bool Initialize(void)
unsigned short bfEnableRecv
Definition: NetworkChannel.h:316
unsigned short bfOpen
Definition: NetworkChannel.h:305
unsigned int GetSocket(void)
Definition: NetworkChannel.h:192
unsigned short bfConnected
Definition: NetworkChannel.h:312
virtual int getSocketPort(void)
unsigned short bfReliable
Definition: NetworkChannel.h:308
SOCKADDR_IN m_ipLocal
Definition: NetworkChannel.h:300
Definition: NetworkChannel.h:303
CRITICAL_SECTION m_csChannelSynchronized
Definition: NetworkChannel.h:296
virtual int getSocketDescriptor(void)
bool IsConnected(void)
Definition: NetworkChannel.h:223
INetDispatch * m_piNetDispatch
Definition: NetworkChannel.h:297
unsigned short bfDirection
Definition: NetworkChannel.h:306
virtual bool Bind(SOCKADDR_IN *lpAddr=NULL)
bool IsOpened(void)
Definition: NetworkChannel.h:213
struct CNetworkChannel::tagChannelFlags m_fFlags
virtual bool Connect(unsigned char *puchIPAddress=NULL, unsigned short usPortID=0)
void SetRemoteAddress(SOCKADDR_IN *lpAddr)
void GetRemoteAddress(SOCKADDR_IN *lpAddr)
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
unsigned short bfConnectFailed
Definition: NetworkChannel.h:313
SOCKADDR_IN m_ipRemote
Definition: NetworkChannel.h:301
unsigned short bfListening
Definition: NetworkChannel.h:315
CNetworkChannel(INetDispatch *piNetDispatch=NULL, unsigned short usPort=0)
static unsigned short GetNewPort(void)
Definition: BaseClass.h:118
unsigned short bfConnectPending
Definition: NetworkChannel.h:311
virtual int Receive(unsigned char *puchBuffer, unsigned long ulRxBytes)
virtual void Dispatch(unsigned char *puchBuffer, unsigned long ulBytesRecvd)
interface unsigned long ulBytesToSend
Definition: INetworkRender.h:57
virtual bool Open(int iAddressType, int iSocketType, int iProtocol)
int m_hSocket
Definition: NetworkChannel.h:298
virtual int Send(unsigned char *puchDataBuffer, unsigned long ulBytesToSend)