Twitch SDK (Internal)
Public Member Functions | List of all members
ttv::IWebSocketFactory Class Referenceabstract

#include <socket.h>

Inheritance diagram for ttv::IWebSocketFactory:
ttv::binding::java::JavaWebSocketFactory ttv::StandardWebSocketFactory

Public Member Functions

virtual ~IWebSocketFactory ()=default
 
virtual bool IsProtocolSupported (const std::string &protocol)=0
 
virtual TTV_ErrorCode CreateWebSocket (const std::string &uri, std::shared_ptr< IWebSocket > &result)=0
 

Detailed Description

An interface for classes that can create IWebSocket instances. An IWebSocketFactory generally supports the ws and wss protocols.

See also
RegisterWebSocketFactory

Constructor & Destructor Documentation

◆ ~IWebSocketFactory()

virtual ttv::IWebSocketFactory::~IWebSocketFactory ( )
virtualdefault

Destructor.

Member Function Documentation

◆ CreateWebSocket()

virtual TTV_ErrorCode ttv::IWebSocketFactory::CreateWebSocket ( const std::string &  uri,
std::shared_ptr< IWebSocket > &  result 
)
pure virtual

Attempts to create an IWebSocket instance that supports the given URI.

See also
ttv::RegisterWebSocketFactory
Parameters
[in]uriThe full uri to create the socket for.
[out]resultThe resulting IWebSocket instance if it was able to be created.
Returns
  • TTV_EC_SUCCESS: The result has been populated with an IWebSocket instance to use.
  • TTV_EC_UNIMPLEMENTED: This factory does not support the protocol.

Implemented in ttv::binding::java::JavaWebSocketFactory, and ttv::StandardWebSocketFactory.

◆ IsProtocolSupported()

virtual bool ttv::IWebSocketFactory::IsProtocolSupported ( const std::string &  protocol)
pure virtual

Determines if this factory supports the given protocol. If the factory claims that is supports the given protocol then it must return a valid ISocket instance from CreateWebSocket().

Parameters
[in]protocolThe protocol to check support for.
Returns
true if the protocol is supported, false otherwise.

Implemented in ttv::binding::java::JavaWebSocketFactory, and ttv::StandardWebSocketFactory.


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