SNode.C
Loading...
Searching...
No Matches
web::websocket::client::SocketContextUpgrade Class Reference

#include <SocketContextUpgrade.h>

Inheritance diagram for web::websocket::client::SocketContextUpgrade:
Collaboration diagram for web::websocket::client::SocketContextUpgrade:

Public Member Functions

 SocketContextUpgrade (core::socket::stream::SocketConnection *socketConnection, web::http::SocketContextUpgradeFactory< web::http::client::Request, web::http::client::Response > *socketContextUpgradeFactory)
 
 ~SocketContextUpgrade () override
 
std::string loadSubProtocol (const std::string &subProtocolName)
 
- Public Member Functions inherited from web::websocket::SocketContextUpgrade< SubProtocol, web::http::client::Request, web::http::client::Response >
 SocketContextUpgrade ()=delete
 
 SocketContextUpgrade (const SocketContextUpgrade &)=delete
 
SocketContextUpgradeoperator= (const SocketContextUpgrade &)=delete
 
 ~SocketContextUpgrade () override=default
 
- Public Member Functions inherited from core::socket::stream::SocketContext
 SocketContext (core::socket::stream::SocketConnection *socketConnection)
 
void sendToPeer (const char *chunk, std::size_t chunkLen) const final
 
bool streamToPeer (core::pipe::Source *source) const
 
void streamEof ()
 
std::size_t readFromPeer (char *chunk, std::size_t chunklen) const final
 
void setTimeout (const utils::Timeval &timeout) final
 
void shutdownRead ()
 
void shutdownWrite (bool forceClose=false)
 
void close () override
 
SocketConnectiongetSocketConnection () const
 
virtual void switchSocketContext (SocketContext *newSocketContext)
 
void sendToPeer (const std::string &data) const
 
- Public Member Functions inherited from core::socket::SocketContext
 SocketContext (const SocketContext &)=delete
 
 SocketContext (SocketContext &&)=delete
 
SocketContextoperator= (const SocketContext &)=delete
 
SocketContextoperator= (SocketContext &&)=delete
 
void sendToPeer (const std::string &data) const
 
- Public Member Functions inherited from web::websocket::SubProtocolContext
 SubProtocolContext (core::socket::stream::SocketConnection *socketConnection, bool role)
 
 SubProtocolContext (const SubProtocolContext &)=delete
 
 ~SubProtocolContext () override
 
SubProtocolContextoperator= (const SubProtocolContext &)=delete
 

Private Attributes

web::websocket::SubProtocolFactory< SubProtocol > * subProtocolFactory = nullptr
 

Additional Inherited Members

- Public Types inherited from web::websocket::SocketContextUpgrade< SubProtocol, web::http::client::Request, web::http::client::Response >
using SubProtocol
 
using Request
 
using Response
 
- Public Types inherited from web::websocket::SubProtocolContext
enum  OpCode {
  CONTINUATION = 0x00 , TEXT = 0x01 , BINARY = 0x02 , CLOSE = 0x08 ,
  PING = 0x09 , PONG = 0x0A
}
 
- Protected Types inherited from web::websocket::SocketContextUpgrade< SubProtocol, web::http::client::Request, web::http::client::Response >
enum  Role
 
- Protected Types inherited from web::http::SocketContextUpgrade< web::http::client::Request, web::http::client::Response >
using Request
 
using Response
 
using SocketContextUpgradeFactory
 
- Protected Member Functions inherited from web::websocket::SocketContextUpgrade< SubProtocol, web::http::client::Request, web::http::client::Response >
 SocketContextUpgrade (core::socket::stream::SocketConnection *socketConnection, web::http::SocketContextUpgradeFactory< Request, Response > *socketContextUpgradeFactory, Role role)
 
- Protected Member Functions inherited from web::http::SocketContextUpgrade< web::http::client::Request, web::http::client::Response >
 SocketContextUpgrade (core::socket::stream::SocketConnection *socketConnection, SocketContextUpgradeFactory *socketContextUpgradeFactory)
 
 ~SocketContextUpgrade () override
 
- Protected Member Functions inherited from core::socket::stream::SocketContext
void onWriteError (int errnum) override
 
void onReadError (int errnum) override
 
- Protected Member Functions inherited from core::socket::SocketContext
 SocketContext ()=default
 
virtual ~SocketContext ()
 
- Protected Member Functions inherited from web::websocket::Receiver
 Receiver (core::socket::stream::SocketConnection *socketConnection)
 
 Receiver (const Receiver &)=delete
 
Receiveroperator= (const Receiver &)=delete
 
virtual ~Receiver ()
 
std::size_t receive ()
 
- Protected Member Functions inherited from web::websocket::Transmitter
 Transmitter (core::socket::stream::SocketConnection *socketConnection, bool masking)
 
void sendMessage (uint8_t opCode, const char *message, std::size_t messageLength)
 
void sendMessageStart (uint8_t opCode, const char *message, std::size_t messageLength)
 
void sendMessageFrame (const char *message, std::size_t messageLength)
 
void sendMessageEnd (const char *message, std::size_t messageLength)
 
 Transmitter ()=delete
 
 Transmitter (const Transmitter &)=delete
 
Transmitteroperator= (const Transmitter &)=delete
 
virtual ~Transmitter ()
 
- Protected Attributes inherited from web::websocket::SocketContextUpgrade< SubProtocol, web::http::client::Request, web::http::client::Response >
SubProtocolsubProtocol
 
- Protected Attributes inherited from web::websocket::Transmitter
bool closeSent = false
 

Detailed Description

Definition at line 49 of file SocketContextUpgrade.h.

Constructor & Destructor Documentation

◆ SocketContextUpgrade()

web::websocket::client::SocketContextUpgrade::SocketContextUpgrade ( core::socket::stream::SocketConnection * socketConnection,
web::http::SocketContextUpgradeFactory< web::http::client::Request, web::http::client::Response > * socketContextUpgradeFactory )

Definition at line 32 of file SocketContextUpgrade.cpp.

References SocketContextUpgrade().

Referenced by SocketContextUpgrade().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~SocketContextUpgrade()

web::websocket::client::SocketContextUpgrade::~SocketContextUpgrade ( )
override

Definition at line 39 of file SocketContextUpgrade.cpp.

References web::websocket::client::SubProtocolFactorySelector::instance(), and subProtocolFactory.

Here is the call graph for this function:

Member Function Documentation

◆ loadSubProtocol()

std::string web::websocket::client::SocketContextUpgrade::loadSubProtocol ( const std::string & subProtocolName)

Definition at line 47 of file SocketContextUpgrade.cpp.

47 {
48 std::string selectedSubProtocolName;
49
51
52 if (subProtocolFactory != nullptr) {
54 selectedSubProtocolName = subProtocol != nullptr ? subProtocolName : "";
55 }
56
57 return selectedSubProtocolName;
58 }
SubProtocolFactory * select(const std::string &subProtocolName)
SubProtocol * createSubProtocol(SubProtocolContext *subProtocolContext)

References subProtocolFactory.

Member Data Documentation

◆ subProtocolFactory

web::websocket::SubProtocolFactory<SubProtocol>* web::websocket::client::SocketContextUpgrade::subProtocolFactory = nullptr
private

Definition at line 61 of file SocketContextUpgrade.h.

Referenced by loadSubProtocol(), and ~SocketContextUpgrade().


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