BasicService< R, Alloc > Class Template Reference

#include <Pt/Http/Service.h>

Basic HTTP service implementation.

Inherits Service.

Public Member Functions

 BasicService ()
 Default Constructor.
 ~BasicService ()
 Destructor.
Responder * getResponder (const Request &)
 Creates a responder to handle request received by a server.
void releaseResponder (Responder *)
 Destroys a responder created by a server.

Protected Member Functions

virtual Responder * onGetResponder (const Request &)
 Creates a responder to handle request received by a server.
virtual void onReleaseResponder (Responder *r)
 Destroys a responder created by a server.
virtual void onUpgrade (Stream &stream, const Request &request, const Reply &reply)
 Called when a 101 reply has upgraded a connection.

Member Function Documentation

◆ onUpgrade()

virtual void onUpgrade ( Stream & stream,
const Request & request,
const Reply & reply )
protectedvirtualinherited

Runs on the server thread with the Stream the server owns. request and reply are the exchange that finished the

  1. They are valid until this call returns. The responder has already been released. Bind a Channel to stream to accept it. The empty implementation leaves the stream unbound, and the server closes it.

Reimplemented in WebSocketService.