PACK Qt Binding  $VERSION$
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Slots | Public Member Functions | List of all members
WServer Class Reference

#include <server.h>

Inheritance diagram for WServer:

Public Slots

void registerInterface (const QString &path, WInterface *ifc)
 
void registerStatic (const QString &path, const QString &content)
 
void unregisterPath (const QString &)
 deletes whatever registration exists at a specific path More...
 
void register404 (const QString &)
 registers a custom page for a 404 Not Found error More...
 
void register400 (const QString &)
 registers a custom page for a 400 Invalid Request error More...
 
void setReceiveTimeout (int)
 sets the receive timeout of the server More...
 
void restrictSourceHosts (const QPair< QHostAddress, int > &)
 restricts the hosts that can connect to this server More...
 
void enableDebugUrl (bool enable=true)
 enable or disable the /debug path, if enabled a request at that path simply returns the content of the request as a response More...
 

Public Member Functions

 WServer (const QString &path, bool removeIfExist=true, QObject *parent=0)
 
 WServer (const QHostAddress &addr, unsigned short port, QObject *parent=0)
 
virtual ~WServer ()=default
 deletes the server object More...
 
bool isActive () const
 returns true if this is a working server (i.e. the constructor did not have errors) More...
 
int receiveTimeout () const
 
quint16 tcpPort () const
 returns the TCP port if it runs on TCP More...
 

Detailed Description

Represents an SCGI server as a proxy to server side interfaces.

Use the cgi2scgi helper to translate between CGI and SCGI.

Constructor & Destructor Documentation

WServer::WServer ( const QString &  path,
bool  removeIfExist = true,
QObject *  parent = 0 
)

creates a new server listening to a local socket

Parameters
paththe (file) name of the socket (or named pipe on Windows)
removeIfExistif true the socket file is removed before trying to create it again (this is a good idea on Unix/Linux, since existing sockets cannot be created)
parentthe owning QObject of this server
WServer::WServer ( const QHostAddress &  addr,
unsigned short  port,
QObject *  parent = 0 
)

creates a new server listening to a TCP socket

Parameters
addrthe address to listen on
portthe TCP port to listen on
parentowning QObject of this server
virtual WServer::~WServer ( )
virtualdefault

deletes the server object

Member Function Documentation

void WServer::enableDebugUrl ( bool  enable = true)
slot

enable or disable the /debug path, if enabled a request at that path simply returns the content of the request as a response

bool WServer::isActive ( ) const
inline

returns true if this is a working server (i.e. the constructor did not have errors)

int WServer::receiveTimeout ( ) const
inline

returns the current receive timeout in seconds this is the time that a request has to be completely received

void WServer::register400 ( const QString &  e)
slot

registers a custom page for a 400 Invalid Request error

void WServer::register404 ( const QString &  e)
slot

registers a custom page for a 404 Not Found error

void WServer::registerInterface ( const QString &  path,
WInterface ifc 
)
slot

registers an interface to handle a specific path

Parameters
paththe relative path inside the server's address space
ifcthe interface that handles this path
void WServer::registerStatic ( const QString &  path,
const QString &  content 
)
slot

registers a specific content to be served on a path

Parameters
paththe relative path inside the server's address space
contentthe page content to deliver
void WServer::restrictSourceHosts ( const QPair< QHostAddress, int > &  addr)
slot

restricts the hosts that can connect to this server

void WServer::setReceiveTimeout ( int  r)
slot

sets the receive timeout of the server

quint16 WServer::tcpPort ( ) const

returns the TCP port if it runs on TCP

void WServer::unregisterPath ( const QString &  p)
slot

deletes whatever registration exists at a specific path


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