steam-min-cpp
Loading...
Searching...
No Matches
Steam::Networking::IConnection Class Referenceabstract

Transport interface used by the CM networking client. More...

#include <connection.hpp>

Inheritance diagram for Steam::Networking::IConnection:

Public Member Functions

virtual ConnectionState state () const =0
 Retrieve the current connection state.
bool is_connected () const
 Check whether the transport is connected.
virtual void network_connect ()=0
 Initiate the network connection.
virtual void network_close ()=0
 Close the active connection.
virtual void async_send (const std::vector< uint8_t > &data)=0
 Send a raw message frame.
virtual void set_on_frame (std::function< void(std::vector< uint8_t >)> handler)=0
 Register a frame receive handler.
virtual void set_on_disconnect (std::function< void(const std::string &reason)> handler)=0
 Register a disconect handler.

Detailed Description

Transport interface used by the CM networking client.

Implementations provide the underlying network transport (e.g. TCP, WebSocket). The Steam client interacts with this interface to send and receive raw message frames.

Member Function Documentation

◆ async_send()

virtual void Steam::Networking::IConnection::async_send ( const std::vector< uint8_t > & data)
pure virtual

Send a raw message frame.

Parameters
dataSerialized packet payload to transmit.

Implemented in Steam::Networking::TCPConnection.

◆ network_close()

virtual void Steam::Networking::IConnection::network_close ( )
pure virtual

Close the active connection.

Implementations should terminate the transport and release any associated resources.

Implemented in Steam::Networking::TCPConnection.

◆ network_connect()

virtual void Steam::Networking::IConnection::network_connect ( )
pure virtual

Initiate the network connection.

Implementations should begin establishing the underlying transport connection.

Implemented in Steam::Networking::TCPConnection.

◆ set_on_disconnect()

virtual void Steam::Networking::IConnection::set_on_disconnect ( std::function< void(const std::string &reason)> handler)
pure virtual

Register a disconect handler.

The handler is invoked whenever the connection is dropped for any reason.

Parameters
handlerCallback receiving the reason for disconnection

◆ set_on_frame()

virtual void Steam::Networking::IConnection::set_on_frame ( std::function< void(std::vector< uint8_t >)> handler)
pure virtual

Register a frame receive handler.

The handler is invoked whenever a full message frame is received from the transport.

Parameters
handlerCallback receiving the raw frame bytes.

Implemented in Steam::Networking::TCPConnection.

◆ state()

virtual ConnectionState Steam::Networking::IConnection::state ( ) const
pure virtual

Retrieve the current connection state.

Implemented in Steam::Networking::TCPConnection.


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