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

#include <socket.h>

Inheritance diagram for ttv::ISocketFactory:
ttv::binding::java::JavaSocketFactory ttv::OpenSslSocketFactory ttv::RawCFSocketFactory ttv::SecureCFSocketFactory ttv::StandardFileSocketFactory ttv::StandardSocketFactory ttv::WinAppSocketFactory ttv::WinSocketFactory

Public Member Functions

virtual ~ISocketFactory ()=default
 
virtual bool IsProtocolSupported (const std::string &protocol)=0
 
virtual TTV_ErrorCode CreateSocket (const std::string &uri, std::shared_ptr< ISocket > &result)=0
 

Detailed Description

An interface for classes that can create ISocket instances.

See also
RegisterSocketFactory

Constructor & Destructor Documentation

◆ ~ISocketFactory()

virtual ttv::ISocketFactory::~ISocketFactory ( )
virtualdefault

Destructor.

Member Function Documentation

◆ CreateSocket()

virtual TTV_ErrorCode ttv::ISocketFactory::CreateSocket ( const std::string &  uri,
std::shared_ptr< ISocket > &  result 
)
pure virtual

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

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

Implemented in ttv::binding::java::JavaSocketFactory, ttv::OpenSslSocketFactory, ttv::WinAppSocketFactory, ttv::WinSocketFactory, ttv::SecureCFSocketFactory, ttv::StandardFileSocketFactory, ttv::RawCFSocketFactory, and ttv::StandardSocketFactory.

◆ IsProtocolSupported()

virtual bool ttv::ISocketFactory::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 CreateSocket().

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

Implemented in ttv::binding::java::JavaSocketFactory, ttv::OpenSslSocketFactory, ttv::WinAppSocketFactory, ttv::WinSocketFactory, ttv::SecureCFSocketFactory, ttv::StandardFileSocketFactory, ttv::RawCFSocketFactory, and ttv::StandardSocketFactory.


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