sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::WSStaticHttpProtocol Class Reference

Handler for static files (.html, .js, .png, etc) More...

#include <WSStaticHttpProtocol.h>

Inheritance diagram for sptk::WSStaticHttpProtocol:
sptk::WSProtocol

Public Member Functions

 WSStaticHttpProtocol (TCPSocket *socket, const URL &url, const HttpHeaders &headers, const String &staticFilesDirectory)
 Constructor. More...
 
RequestInfo process () override
 Process method. More...
 
- Public Member Functions inherited from sptk::WSProtocol
 WSProtocol (TCPSocket *socket, const HttpHeaders &headers)
 
 WSProtocol (const WSProtocol &)=delete
 
virtual ~WSProtocol ()
 
WSProtocoloperator= (const WSProtocol &)=delete
 
virtual RequestInfo process ()=0
 Process virtual method - to be implemented in derived classes. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sptk::WSProtocol
TCPSocketsocket ()
 
HttpHeaders & headers ()
 
String header (const sptk::String &name)
 

Detailed Description

Handler for static files (.html, .js, .png, etc)

Session disconnects as soon as file is served.

Constructor & Destructor Documentation

◆ WSStaticHttpProtocol()

sptk::WSStaticHttpProtocol::WSStaticHttpProtocol ( TCPSocket socket,
const URL url,
const HttpHeaders &  headers,
const String staticFilesDirectory 
)

Constructor.

Parameters
socketConnection socket
urlResource URL
headersConnection HTTP headers
staticFilesDirectoryString, Directory where static files reside on the server

Member Function Documentation

◆ process()

RequestInfo sptk::WSStaticHttpProtocol::process ( )
overridevirtual

Process method.

Writes HTTP response and file content to the connection

Implements sptk::WSProtocol.


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

Fri Oct 14 2022 09:58:48: SPTK 5.4.1