Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

PollApplLayer Class Reference
[applLayer - application layer modules]

Base station application layer to test centralized scenarios. More...

#include <PollApplLayer.h>

Inherits ClientApplLayer.

Inheritance diagram for PollApplLayer:

Inheritance graph
Collaboration diagram for PollApplLayer:

Collaboration graph
List of all members.

Public Member Functions

 Module_Class_Members (PollApplLayer, ClientApplLayer, 0)
virtual void initialize (int)
 Initialite module parameters.
virtual void finish ()

Protected Types

typedef std::map< int, bool > cAliveMap
typedef std::map< int, int > cNetwAddrMap
typedef cAliveMap::iterator cAliveMapIterator

Protected Member Functions

virtual void handleLowerMsg (cMessage *)
 Handle messages from lower layer...
virtual void handleSelfMsg (cMessage *)
 Handle self messages such as timer...
void sendBroadcast ()
 Send a broadcast packet to all connected neighbors.
void sendPoll (int)
 Send a poll message to 'addr'.
void pollNext ()
 Poll next client in the list.

Protected Attributes

int numClients
 Number of clients in the network.
int aliveClients
 Number of alive clients in the network.
double broadcastInterval
 Time between broadcasts in seconds.
double pollTimeout
 Timeout for poll messages in seconds.
cAliveMap clients
 Map to store all reachable clients.
cNetwAddrMap clientAddrs
 Map to store the netw addresses o fthe clients.
cAliveMapIterator it
 Iterator for the clients map.
cMessage * pollTimer
 Timer message for polling.

Detailed Description

Base station application layer to test centralized scenarios.

Application layer for a base station in a centralized WLAN-like network. Every 'broadcastInterval' it broadcasts a ping message to determine the reachable clients. Afterwards it polls all reachable clients in a round-robin manner, where 'pollTimeout' is the reply timeout for the clients.

See also:
Daniel Willkomm

Member Function Documentation

void PollApplLayer::handleLowerMsg cMessage *  msg  )  [protected, virtual]

Handle messages from lower layer...

There are two kinds of messages that can arrive at this module: The first (kind = BROADCAST_REPLY_MESSAGE) is a reply to a broadcast packet that we have sent and results in an update of the clients list. The second (kind = POLL_REPLY) is a reply to a poll packet that we have sent. The pollTimer has to be deleted and the next client can be polled.

Reimplemented from ClientApplLayer.

void PollApplLayer::handleSelfMsg cMessage *  msg  )  [protected, virtual]

Handle self messages such as timer...

A timer with kind = SEND_BROADCAST_TIMER indicates that a new broadcast has to be send (sendBroadcast).

kind = POLL_REPLY_TIMEOUT invalidates the client entry, and for now just prints debug output and calls pollNext to poll the next client in the list.

kind = BROADCAST_REPLY_TIMEOUT indicates the end of the broadcast period and starts the polling period.

See also:
sendBroadcast, pollNext

Reimplemented from BasicApplLayer.

void PollApplLayer::initialize int  stage  )  [virtual]

Initialite module parameters.

Read ned parameters and schedule first broadcast timer

Reimplemented from BasicApplLayer.

void PollApplLayer::pollNext  )  [protected]

Poll next client in the list.

Poll the next reachable client in the list. If there are no more clients, just return.

void PollApplLayer::sendBroadcast  )  [protected]

Send a broadcast packet to all connected neighbors.

This function creates a new broadcast message and sends it down to the network layer

void PollApplLayer::sendPoll int  addr  )  [protected]

Send a poll message to 'addr'.

This function creates a new poll message to poll 'addr' and sends it down to the network layer

addr Address of the client to poll.

The documentation for this class was generated from the following files:
Generated on Fri Jan 12 08:30:13 2007 for Mobility Framework by  doxygen 1.4.4