libradar_stp::RSTPServerIf Class Reference

#include <rstpserverif.h>

List of all members.

Public Types

typedef void(*) STRCB (void *, const std::string &)

Public Member Functions

bool listen (const std::string &local_addr, unsigned short port, int backlog=10)
bool listen (unsigned short port)
bool notifyData (const char *data, unsigned int size)
void quit ()
void setAuthRequired ()
void setAuthCredential (const std::string &login, const std::string &pass)
void setAuthPermission (const std::string &login, const std::string &stream)
void clearAuthSettings ()
void setMaxClients (unsigned int max_clients)
void setFilterStream (const std::string &stream, const std::string &file)
void setPassStream (const std::string &stream)
void setPipeThrough (const std::string &stream, const std::string &cmd)
void setStreamCache (const std::string &stream, int cache_size, const std::string &file)
void setStreamAddCallback (STRCB func, void *arg=0)
void setStreamDropCallback (STRCB func, void *arg=0)
void addBroadcastData (const std::string &data)
void addBroadcastFile (const std::string &file)
void setBroadcastInterval (unsigned int interval)
void setLogging (const std::string &file, int level=1, std::string progid="")
void setStatusFile (const std::string &file)
bool loadFile (const std::string &filename)


Detailed Description

This class provides a high-level RSTP server interface. It is recommended for all RSTP server applications.

To use: Enable streams, perform other configuration, then listen(). As data becomes available, send it to clients using notifyData(). On exit, call quit() to cleanup the threads.


Member Function Documentation

void RSTPServerIf::clearAuthSettings (  ) 

Clear authentication configuration. Useful when reloading configuration files.

bool RSTPServerIf::listen ( unsigned short  port  ) 

Simplified case of the longer listen()

bool RSTPServerIf::listen ( const std::string &  local_addr,
unsigned short  port,
int  backlog = 10 
)

Parameters:
local_addr The local IP address to bind to (dotted decimal).
port The local TCP/IP port to bind to.
backlog The backlog argument for the socket listen() call.
Call after configuration to start the server.

bool RSTPServerIf::loadFile ( const std::string &  filename  ) 

Parameters:
filename The name of the configuration file to load.
See also:
Server configuration file documentation
Load server configuration from a file.

bool RSTPServerIf::notifyData ( const char *  data,
unsigned int  size 
)

Parameters:
data Pointer to the actual data
size Length of the data
Call to send data to connected clients

void RSTPServerIf::quit (  ) 

Call when you're done for cleanup.

void RSTPServerIf::setAuthCredential ( const std::string &  login,
const std::string &  pass 
)

Parameters:
login Login name
pass The password to associate with login
Set the password for an authorized user.

void RSTPServerIf::setAuthPermission ( const std::string &  login,
const std::string &  stream 
)

Parameters:
login The login name to authorize
stream The stream name to authorize for login
Set the password for an authorized user.

void RSTPServerIf::setAuthRequired (  ) 

Require client authentication

void RSTPServerIf::setFilterStream ( const std::string &  stream,
const std::string &  file 
)

Parameters:
stream Name of the stream to create.
file The filter file.
See also:
libradar_stp::Filter for filter file format.
Create a stream which will forward all data products which pass the named filter. See libradar_stp::Filter class documentation for format.

void RSTPServerIf::setLogging ( const std::string &  file,
int  level = 1,
std::string  progid = "" 
)

Enable the server log.

Parameters:
file The log file to write entries to
level The logging level - default 1
progid Log entry identifier

void RSTPServerIf::setMaxClients ( unsigned int  max_clients  ) 

Limit concurrent connections.

Parameters:
max_clients The maximum number of connections to allow.

void RSTPServerIf::setPassStream ( const std::string &  stream  ) 

Parameters:
stream The catch-all stream name.
Enable a catch-all stream. All data will be sent to clients who have requested this stream.

void RSTPServerIf::setStatusFile ( const std::string &  file  ) 

Parameters:
file The name of the status file to create. It will be plain text.
Enable the status file feature. This will cause the server to maintain a formatted text file describing all current connections.


The documentation for this class was generated from the following files:
Generated on Tue Jul 1 20:25:26 2008 for libradar_stp by  doxygen 1.4.7