Main Page | Class List | File List | Class Members | File Members | Related Pages

WSHttpServer Class Reference

WSHttpServer class is a minimal web server for KWebSnap. More...

#include <wshttpserver.h>

List of all members.

Signals

void newConnect ()
void endConnect ()
void wroteToClient ()
void message (const QString &text, int type=Configuration::Normal)

Public Member Functions

 WSHttpServer (QObject *parent=0)
 ~WSHttpServer ()
void newConnection (int socket)


Detailed Description

WSHttpServer class is a minimal web server for KWebSnap.

It provides minimal service to handle requests for files. Every request is a separate connection, and upon sending the response, the connection is closed. It also supports sending compressed (deflate) responses.

The files accesible thru this web server are governed by the Configuration::WWW.Files list. Only files in the list can be accessed. There is no directory resolution, and all files are accessed by their name. So if we have a file main.png, then it is accessed using the URL http://ip:port/main.png, where ip is the IP of the computer (eg. 123.345.567.789), and port is the Port specified thru Config().

Definition at line 51 of file wshttpserver.h.


Constructor & Destructor Documentation

WSHttpServer::WSHttpServer QObject *  parent = 0  ) 
 

Default constructor. Call QServerSocket::ok() to find out if construction suceeded.

Parameters:
parent the parent object

Definition at line 38 of file wshttpserver.cpp.

References Config(), and message().

WSHttpServer::~WSHttpServer  ) 
 

Default destructor.

Definition at line 56 of file wshttpserver.cpp.


Member Function Documentation

void WSHttpServer::endConnect  )  [signal]
 

Signal emitted when a connection is closed with a client.

void WSHttpServer::message const QString &  text,
int  type = Configuration::Normal
[signal]
 

Sends log message.

Parameters:
text the message text
type the message type

Referenced by newConnection(), and WSHttpServer().

void WSHttpServer::newConnect  )  [signal]
 

Signal emitted when a new connection is made with the server.

Referenced by newConnection().

void WSHttpServer::newConnection int  socket  ) 
 

Slot for a new connection. When a new client connects, the server constructs a QSocket and all communication with the client is done over this QSocket. QSocket works asynchronously.

Parameters:
socket The file descriptor for the newly accepted connection.

Definition at line 60 of file wshttpserver.cpp.

References message(), and newConnect().

void WSHttpServer::wroteToClient  )  [signal]
 

Signal emitted when we wrote something to the client.


The documentation for this class was generated from the following files:
Generated on Mon Sep 5 12:52:34 2005 for kwebsnap.kdevelop by  doxygen 1.3.9.1