Download Source Code

CWinSocketProtocol Class Reference

Base class for CWinAsyncSocket protocol handlers. More...

#include <WinAsyncSocket.h>

Inheritance diagram for CWinSocketProtocol:

Inheritance graph
[legend]
Collaboration diagram for CWinSocketProtocol:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CWinSocketProtocol ()
 Default constructor.
virtual ~CWinSocketProtocol ()
 Destructor.
virtual BOOL OnWrite (int nErr)=0
 Called when there is data to be transmitted.
virtual BOOL OnRead (int nErr)=0
 Called when new data arrives.
virtual HANDLE GetDataReadyHandle ()=0
 Return a valid handle if you want to receive data tx messages.
virtual BOOL OnDataReady ()=0
 Called when the event handle returned by GetDataReadyHandle() is set.
CWinSocketGetSocket ()
 Returns a pointer the attached socket.
void SetSocket (CWinSocket *pSocket)
 Sets the attached socket.
CWinAsyncSocketGetAsyncSocket ()
 Returns a pointer the attached socket.
void SetAsyncSocket (CWinAsyncSocket *pSocket)
 Sets the attached socket.

Detailed Description

Base class for CWinAsyncSocket protocol handlers.

Derive from this class to implement a protocol handler for TWinAsyncSocket.

Supports both TCP and UDP protocols.

See also:
TWinAsyncSocket, CWinAsyncSocket, CWinSocket


Member Function Documentation

virtual HANDLE CWinSocketProtocol::GetDataReadyHandle  )  [pure virtual]
 

Return a valid handle if you want to receive data tx messages.

Returns:
Waitable event handle
See also:

Implemented in CWspStream.

virtual BOOL CWinSocketProtocol::OnDataReady  )  [pure virtual]
 

Called when the event handle returned by GetDataReadyHandle() is set.

Returns:
Non-zero if success
See also:

Implemented in CWspStream.

virtual BOOL CWinSocketProtocol::OnRead int  nErr  )  [pure virtual]
 

Called when new data arrives.

Parameters:
[in] nErr - Error code
Returns:
Non-zero if success
See also:

Implemented in CWspStream.

virtual BOOL CWinSocketProtocol::OnWrite int  nErr  )  [pure virtual]
 

Called when there is data to be transmitted.

Parameters:
[in] nErr - Error code
Returns:
Non-zero if success
See also:

Implemented in CWspStream.

void CWinSocketProtocol::SetAsyncSocket CWinAsyncSocket pSocket  )  [inline]
 

Sets the attached socket.

Parameters:
[in] pSocket - Pointer to CWinAsyncSocket object

void CWinSocketProtocol::SetSocket CWinSocket pSocket  )  [inline]
 

Sets the attached socket.

Parameters:
[in] pSocket - Pointer to CWinSocket object


The documentation for this class was generated from the following file:
  • inc/WinAsyncSocket.h
Copyright Robert Umbehant
This documentation is covered by the LGPL