Content Managers - rsandila/traffic3 GitHub Wiki

Purpose

Content Managers generate the content that will be sent by the client and server. Both a client and a server need an assigned content manager.

Currently the following content managers are supported:

  1. Fixed
  2. Random text
  3. Random binary
  4. Echo

Description

Generic

Content Managers take two variables, one is called min, the other is called max. They are interpreted differently by different content managers.

Fixed Content Manager

This will create a fixed block of data the size of max and fill it with characters specified by min. This block will be sent by either the client/server using the content manager.

Random Text Content Manager

This will create a randomly sized block of data with random text characters. The size of the block will be between min and max characters in length. All character values will be between 32 and 127.

Because it generates random content, this may be limited in how much bandwidth it can consume.

Random Binary Content Manager

This will create a randomly sized block of data with random characters. The size of the block will be between min and max characters in length.

Because it generates random content, this may be limited in how much bandwidth it can consume.

Echo Content Manager

This will just reply with the data received. It should be obvious that specifying echo for both client and server at the same time will not be very productive. The variables min and max is ignored.

Creating your own Content Manager

It should be rather trivial to create your own content manager. Take a look at contentmanager_fixed.cpp for an example. Please add unit tests and remember to add it to the CLI, contentmanagerfactory.h and contentmanagertype.h.