MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Public Member Functions | Private Attributes
IPC::statExchange Class Reference

A class used for the exchange of statistics over shared memory. More...

#include <shared_memory.h>

Public Member Functions

 statExchange (char *_data)
 StatExchange constructor, sets the datapointer to the given value. More...
 
 statExchange (char *_data)
 
void connector (std::string name)
 
void connector (std::string name)
 Sets the name of the connector through which this user is viewing. More...
 
std::string connector ()
 Gets the name of the connector through which this user is viewing. More...
 
std::string connector ()
 
void crc (unsigned int sum)
 Sets checksum field. More...
 
void crc (unsigned int sum)
 
unsigned int crc ()
 
unsigned int crc ()
 Gets checksum field. More...
 
void down (long long int bytes)
 Sets the amount of bytes received. More...
 
void down (long long int bytes)
 
long long int down ()
 Gets the amount of bytes received. More...
 
long long int down ()
 
char getSync ()
 Gets checksum field. More...
 
char getSync ()
 
void host (std::string name)
 
void host (std::string name)
 Sets the host of this connection. More...
 
std::string host ()
 
std::string host ()
 Gets the host of this connection. More...
 
void lastSecond (long time)
 
void lastSecond (long time)
 Sets the last viewing second of this user. More...
 
long lastSecond ()
 Gets the last viewing second of this user. More...
 
long lastSecond ()
 
void now (long long int time)
 Sets timestamp of the current stats. More...
 
void now (long long int time)
 
long long int now ()
 
long long int now ()
 Gets timestamp of the current stats. More...
 
void setSync (char s)
 Sets checksum field. More...
 
void setSync (char s)
 
void streamName (std::string name)
 Sets the name of the stream this user is viewing. More...
 
void streamName (std::string name)
 
std::string streamName ()
 
std::string streamName ()
 Gets the name of the stream this user is viewing. More...
 
void time (long time)
 Sets time currently connected. More...
 
void time (long time)
 
long time ()
 Gets time currently connected. More...
 
long time ()
 
void up (long long int bytes)
 
void up (long long int bytes)
 Sets the amount of bytes sent. More...
 
long long int up ()
 Gets the amount of bytes sent. More...
 
long long int up ()
 

Private Attributes

char * data
 The payload for the stat exchange. More...
 

Detailed Description

A class used for the exchange of statistics over shared memory.

Constructor & Destructor Documentation

IPC::statExchange::statExchange ( char *  _data)

StatExchange constructor, sets the datapointer to the given value.

IPC::statExchange::statExchange ( char *  _data)

Member Function Documentation

void IPC::statExchange::connector ( std::string  name)

Sets the name of the connector through which this user is viewing.

void IPC::statExchange::connector ( std::string  name)
std::string IPC::statExchange::connector ( )

Gets the name of the connector through which this user is viewing.

std::string IPC::statExchange::connector ( )
void IPC::statExchange::crc ( unsigned int  sum)

Sets checksum field.

void IPC::statExchange::crc ( unsigned int  sum)
unsigned int IPC::statExchange::crc ( )

Gets checksum field.

unsigned int IPC::statExchange::crc ( )
void IPC::statExchange::down ( long long int  bytes)

Sets the amount of bytes received.

void IPC::statExchange::down ( long long int  bytes)
long long int IPC::statExchange::down ( )

Gets the amount of bytes received.

long long int IPC::statExchange::down ( )
char IPC::statExchange::getSync ( )

Gets checksum field.

char IPC::statExchange::getSync ( )
void IPC::statExchange::host ( std::string  name)

Sets the host of this connection.

void IPC::statExchange::host ( std::string  name)
std::string IPC::statExchange::host ( )
std::string IPC::statExchange::host ( )

Gets the host of this connection.

void IPC::statExchange::lastSecond ( long  time)
void IPC::statExchange::lastSecond ( long  time)

Sets the last viewing second of this user.

long IPC::statExchange::lastSecond ( )
long IPC::statExchange::lastSecond ( )

Gets the last viewing second of this user.

void IPC::statExchange::now ( long long int  time)

Sets timestamp of the current stats.

void IPC::statExchange::now ( long long int  time)
long long int IPC::statExchange::now ( )

Gets timestamp of the current stats.

long long int IPC::statExchange::now ( )
void IPC::statExchange::setSync ( char  s)

Sets checksum field.

void IPC::statExchange::setSync ( char  s)
void IPC::statExchange::streamName ( std::string  name)
void IPC::statExchange::streamName ( std::string  name)

Sets the name of the stream this user is viewing.

std::string IPC::statExchange::streamName ( )
std::string IPC::statExchange::streamName ( )

Gets the name of the stream this user is viewing.

void IPC::statExchange::time ( long  time)
void IPC::statExchange::time ( long  time)

Sets time currently connected.

long IPC::statExchange::time ( )
long IPC::statExchange::time ( )

Gets time currently connected.

void IPC::statExchange::up ( long long int  bytes)
void IPC::statExchange::up ( long long int  bytes)

Sets the amount of bytes sent.

long long int IPC::statExchange::up ( )
long long int IPC::statExchange::up ( )

Gets the amount of bytes sent.

Field Documentation

char * IPC::statExchange::data
private

The payload for the stat exchange.

  • 8 byte - now (timestamp of last statistics)
  • 4 byte - time (duration of the current connection)
  • 4 byte - lastSecond (last second of content viewed)
  • 8 byte - down (Number of bytes received from peer)
  • 8 byte - up (Number of bytes sent to peer)
  • 16 byte - host (ip address of the peer)
  • 100 byte - streamName (name of the stream peer is viewing)
  • 20 byte - connector (name of the connector the peer is using)
  • 4 byte - CRC32 of user agent (or zero if none)
  • 1 byte sync (was seen by controller yes/no)
  • (implicit 2 bytes: PID)

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