sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::WSProtocol Class Referenceabstract

Abstract base class for different protocols used in Web Service servers. More...

#include <WSProtocol.h>

Inheritance diagram for sptk::WSProtocol:
sptk::BaseWebServiceProtocol sptk::WSStaticHttpProtocol sptk::WSWebSocketsProtocol sptk::WSWebServiceProtocol

Public Member Functions

 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...
 

Protected Member Functions

TCPSocketsocket ()
 
HttpHeaders & headers ()
 
String header (const sptk::String &name)
 

Detailed Description

Abstract base class for different protocols used in Web Service servers.

Constructor & Destructor Documentation

◆ WSProtocol()

sptk::WSProtocol::WSProtocol ( TCPSocket socket,
const HttpHeaders &  headers 
)
inline

Constructor Note: the socket is not owned by this class and not discarded by destructor.

Parameters
socketConnection socket
headersConnection HTTP headers

◆ ~WSProtocol()

virtual sptk::WSProtocol::~WSProtocol ( )
inlinevirtual

Destructor

Closes connection

References sptk::TCPSocket::close().

Member Function Documentation

◆ header()

String sptk::WSProtocol::header ( const sptk::String name)
protected

Connection HTTP headers

Returns
Connection HTTP headers

◆ headers()

HttpHeaders & sptk::WSProtocol::headers ( )
inlineprotected

Connection HTTP headers

Returns
Connection HTTP headers

◆ process()

virtual RequestInfo sptk::WSProtocol::process ( )
pure virtual

Process virtual method - to be implemented in derived classes.

Implemented in sptk::WSStaticHttpProtocol, sptk::WSWebServiceProtocol, and sptk::WSWebSocketsProtocol.

◆ socket()

TCPSocket & sptk::WSProtocol::socket ( )
inlineprotected

Connection socket

Returns
Connection socket

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

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