nalchi
Loading...
Searching...
No Matches
socket_extensions_flat.hpp File Reference

Socket extensions flat API. More...

#include "nalchi/socket_extensions.hpp"

Go to the source code of this file.

Functions

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, std::int64_t user_data)
 Unicasts a shared_payload to a connection.
 
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, std::int64_t user_data)
 Multicasts a shared_payload to the connections.
 

Detailed Description

Socket extensions flat API.

Function Documentation

◆ nalchi_socket_extensions_multicast()

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,
std::int64_t user_data )

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_countNumber of connections.
connectionsConnections to multicast to.
payloadPayload to send.
logical_bytes_lengthLogical number of bytes of the payload.
send_flagsSend flags. See message sending flags on the Steamworks docs.
out_message_number_or_resultOptional pointer to receive the message number if successful, or a negative EResult value if failed.
laneOptional lane index. See ISteamNetworkingSockets::ConfigureConnectionLanes for details.
user_dataOptional user data.

◆ nalchi_socket_extensions_unicast()

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,
std::int64_t user_data )

Unicasts a shared_payload to a connection.

This function is pretty similar to the ISteamNetworkingSockets::SendMessageToConnection(), but it's for the nalchi::shared_payload.
But, it uses ISteamNetworkingSockets::SendMessages() under the hood, so the result is returns with out_message_number_or_result instead of a return value.

Parameters
connectionConnection to send to.
payloadPayload to send.
logical_bytes_lengthLogical number of bytes of the payload.
send_flagsSend flags. See message sending flags on the Steamworks docs.
out_message_number_or_resultOptional pointer to receive the message number if successful, or a negative EResult value if failed.
laneOptional lane index. See ISteamNetworkingSockets::ConfigureConnectionLanes for details.
user_dataOptional user data.