Extensions for ISteamNetworkingSockets
.
More...
#include <nalchi/socket_extensions.hpp>
|
static void | unicast (ISteamNetworkingSockets *sockets, HSteamNetConnection connection, nalchi::shared_payload payload, int logical_bytes_length, int send_flags, std::int64_t *out_message_number_or_result, std::uint16_t lane=0, std::int64_t user_data=0) |
| Unicasts a shared_payload to a connection.
|
|
template<typed_input_range< HSteamNetConnection > ConnectionRange> |
static void | multicast (ISteamNetworkingSockets *sockets, ConnectionRange &&connections, nalchi::shared_payload payload, int logical_bytes_length, int send_flags, std::span< std::int64_t > out_message_number_or_result, std::uint16_t lane=0, std::int64_t user_data=0) |
| Multicasts a shared_payload to the connections.
|
|
static void | multicast (ISteamNetworkingSockets *sockets, unsigned connections_count, const HSteamNetConnection *connections, nalchi::shared_payload payload, int logical_bytes_length, int send_flags, std::int64_t *out_message_number_or_result, std::uint16_t lane=0, std::int64_t user_data=0) |
| Multicasts a shared_payload to the connections.
|
|
Extensions for ISteamNetworkingSockets
.
◆ multicast() [1/2]
template<typed_input_range< HSteamNetConnection > ConnectionRange>
static void nalchi::socket_extensions::multicast |
( |
ISteamNetworkingSockets * | sockets, |
|
|
ConnectionRange && | connections, |
|
|
nalchi::shared_payload | payload, |
|
|
int | logical_bytes_length, |
|
|
int | send_flags, |
|
|
std::span< std::int64_t > | out_message_number_or_result, |
|
|
std::uint16_t | lane = 0, |
|
|
std::int64_t | user_data = 0 ) |
|
inlinestatic |
Multicasts a shared_payload
to the connections.
This function uses ISteamNetworkingSockets::SendMessages()
under the hood, but it shares the payload between them.
So, it's more efficient if you send a same message to a lot of connections with this.
- Template Parameters
-
ConnectionRange | Connection range type that can take any iterable range of HSteamNetConnection . |
- Parameters
-
connections | Connections to multicast to. |
payload | Payload to send. |
logical_bytes_length | Logical number of bytes of the payload. |
send_flags | Send flags. See message sending flags on the Steamworks docs. |
out_message_number_or_result | Optional pointer to receive the message number if successful, or a negative EResult value if failed. |
lane | Optional lane index. See ISteamNetworkingSockets::ConfigureConnectionLanes for details. |
user_data | Optional user data. |
◆ multicast() [2/2]
static void nalchi::socket_extensions::multicast |
( |
ISteamNetworkingSockets * | sockets, |
|
|
unsigned | connections_count, |
|
|
const HSteamNetConnection * | connections, |
|
|
nalchi::shared_payload | payload, |
|
|
int | logical_bytes_length, |
|
|
int | send_flags, |
|
|
std::int64_t * | out_message_number_or_result, |
|
|
std::uint16_t | lane = 0, |
|
|
std::int64_t | user_data = 0 ) |
|
static |
Multicasts a shared_payload
to the connections.
This function uses ISteamNetworkingSockets::SendMessages()
under the hood, but it shares the payload between them.
So, it's more efficient if you send a same message to a lot of connections with this.
- Parameters
-
connections_count | Number of connections . |
connections | Connections to multicast to. |
payload | Payload to send. |
logical_bytes_length | Logical number of bytes of the payload. |
send_flags | Send flags. See message sending flags on the Steamworks docs. |
out_message_number_or_result | Optional pointer to receive the message number if successful, or a negative EResult value if failed. |
lane | Optional lane index. See ISteamNetworkingSockets::ConfigureConnectionLanes for details. |
user_data | Optional user data. |
◆ unicast()
static void nalchi::socket_extensions::unicast |
( |
ISteamNetworkingSockets * | sockets, |
|
|
HSteamNetConnection | connection, |
|
|
nalchi::shared_payload | payload, |
|
|
int | logical_bytes_length, |
|
|
int | send_flags, |
|
|
std::int64_t * | out_message_number_or_result, |
|
|
std::uint16_t | lane = 0, |
|
|
std::int64_t | user_data = 0 ) |
|
static |
The documentation for this class was generated from the following file: