# IAX2Receiver Class Reference

`#include <receiver.h>`

Collaboration diagram for IAX2Receiver:

[legend]

## Public Member Functions

Constructors/destructors
| IAX2Receiver (IAX2EndPoint &_newEndpoint, PUDPSocket &_newSocket)
| ~IAX2Receiver ()
general worker methods
virtual void | Main ()
virtual void | Terminate ()
PBoolean | ReadNetworkSocket ()
void | AddNewReceivedFrame (IAX2Frame *newFrame)
PINDEX | GetSize ()

## Protected Attributes

IAX2EndPoint & | endpoint
PUDPSocket & | sock
IAX2FrameList | fromNetworkFrames
PBoolean | keepGoing

## Detailed Description

Manage the reception of etherenet packets on the specified port. All received packets are handed to the appropriate connection. A separate thread is used to wait on the ethernet port

## Constructor & Destructor Documentation

IAX2Receiver::IAX2Receiver | ( | IAX2EndPoint & | _newEndpoint,
|  | PUDPSocket & | _newSocket |
| ) |  |  |

Construct a receiver, given references to the endpoint and socket

IAX2Receiver::~IAX2Receiver | ( |  | ) |

Destroy the receiver

## Member Function Documentation

void IAX2Receiver::AddNewReceivedFrame | ( | IAX2Frame * | newFrame | ) |

We have just read a frame from the network. This is a good IAX2Frame. Put it on the queue of frames to be processed by the IAX2EndPoint. The IAX2EndPoint will give this frame to the appropriate IAXConnection. Since this frame could be encrypted, and we do not have access to the keys (only the IAX2Connection has the keys, we cannot do anymore with the frame). Indeed, we are the receiving thread, and must put all our time into reading from the socket, not processing the packets.

PINDEX IAX2Receiver::GetSize | ( |  | ) | `[inline]`

Report how many frames are in the receive queue, waiting for extraction

virtual void IAX2Receiver::Main | ( |  | ) | `[virtual]`

PBoolean IAX2Receiver::ReadNetworkSocket | ( |  | ) |

Sit in here, waiting for data on the socket

virtual void IAX2Receiver::Terminate | ( |  | ) | `[virtual]`

Close down this thread in a civilised fashion, by sending an empty packet to the PUDPSocket of this protocol. The Receiver will receive this packet, and check the close down flag, and so realise it is time to close down.

## Field Documentation

IAX2EndPoint& IAX2Receiver::endpoint `[protected]`

Global variable which holds the application specific data

IAX2FrameList IAX2Receiver::fromNetworkFrames `[protected]`

The act of processing a header will (inevitably) create additional frames as trunked frames are split up

PBoolean IAX2Receiver::keepGoing `[protected]`

Flag to indicate if this receiver thread should keep listening for network data

PUDPSocket& IAX2Receiver::sock `[protected]`

Socket that is used to receive all network data from

The documentation for this class was generated from the following file:

- receiver.h