Class WebSocketControllerBase

Synopsis

#include <lib/inc/drogon/WebSocketController.h>

class WebSocketControllerBase : public virtual DrObjectBase

Description

The abstract base class for WebSocket controllers.

Inheritance

Ancestors: DrObjectBase

Decsendents: WebSocketController

Methods

~WebSocketControllerBase
handleConnectionClosedNo description but mentioned in...
handleNewConnectionNo description but mentioned in...
handleNewMessageNo description but mentioned in...

Source

Lines 39-58 in lib/inc/drogon/WebSocketController.h.

class WebSocketControllerBase : public virtual DrObjectBase
{
  public:
    // This function is called when a new message is received
    virtual void handleNewMessage(const WebSocketConnectionPtr &,
                                  std::string &&,
                                  const WebSocketMessageType &) = 0;

    // This function is called after a new connection of WebSocket is
    // established.
    virtual void handleNewConnection(const HttpRequestPtr &,
                                     const WebSocketConnectionPtr &) = 0;

    // This function is called after a WebSocket connection is closed
    virtual void handleConnectionClosed(const WebSocketConnectionPtr &) = 0;

    virtual ~WebSocketControllerBase()
    {
    }
};





Add Discussion as Guest

Log in to DocsForge