|
steam-min-cpp
|
Transport interface used by the CM networking client. More...
#include <connection.hpp>
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. | |
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.
|
pure virtual |
Send a raw message frame.
| data | Serialized packet payload to transmit. |
Implemented in Steam::Networking::TCPConnection.
|
pure virtual |
Close the active connection.
Implementations should terminate the transport and release any associated resources.
Implemented in Steam::Networking::TCPConnection.
|
pure virtual |
Initiate the network connection.
Implementations should begin establishing the underlying transport connection.
Implemented in Steam::Networking::TCPConnection.
|
pure virtual |
Register a frame receive handler.
The handler is invoked whenever a full message frame is received from the transport.
| handler | Callback receiving the raw frame bytes. |
Implemented in Steam::Networking::TCPConnection.
|
pure virtual |
Retrieve the current connection state.
Implemented in Steam::Networking::TCPConnection.