Rise
The Vieneo Province
Loading...
Searching...
No Matches
SteamNetworkingMessage_t Struct Reference

A message that has been received. More...

#include <steamnetworkingtypes.h>

Collaboration diagram for SteamNetworkingMessage_t:
[legend]

Public Member Functions

void Release ()
uint32 GetSize () const
const void * GetData () const
int GetChannel () const
HSteamNetConnection GetConnection () const
int64 GetConnectionUserData () const
SteamNetworkingMicroseconds GetTimeReceived () const
int64 GetMessageNumber () const

Public Attributes

void * m_pData
 Message payload.
int m_cbSize
 Size of the payload.
HSteamNetConnection m_conn
SteamNetworkingIdentity m_identityPeer
int64 m_nConnUserData
SteamNetworkingMicroseconds m_usecTimeReceived
int64 m_nMessageNumber
void(*) m_pfnFreeData (SteamNetworkingMessage_t *pMsg)
void(*) m_pfnRelease (SteamNetworkingMessage_t *pMsg)
int m_nChannel
int m_nFlags
int64 m_nUserData
uint16 m_idxLane
uint16 _pad1__

Protected Member Functions

 ~SteamNetworkingMessage_t ()

Detailed Description

A message that has been received.

Definition at line 844 of file steamnetworkingtypes.h.

Constructor & Destructor Documentation

◆ ~SteamNetworkingMessage_t()

SteamNetworkingMessage_t::~SteamNetworkingMessage_t ( )
inlineprotected

Definition at line 945 of file steamnetworkingtypes.h.

Member Function Documentation

◆ GetChannel()

int SteamNetworkingMessage_t::GetChannel ( ) const
inline

Definition at line 933 of file steamnetworkingtypes.h.

◆ GetConnection()

HSteamNetConnection SteamNetworkingMessage_t::GetConnection ( ) const
inline

Definition at line 934 of file steamnetworkingtypes.h.

◆ GetConnectionUserData()

int64 SteamNetworkingMessage_t::GetConnectionUserData ( ) const
inline

Definition at line 935 of file steamnetworkingtypes.h.

◆ GetData()

const void * SteamNetworkingMessage_t::GetData ( ) const
inline

Definition at line 932 of file steamnetworkingtypes.h.

◆ GetMessageNumber()

int64 SteamNetworkingMessage_t::GetMessageNumber ( ) const
inline

Definition at line 937 of file steamnetworkingtypes.h.

◆ GetSize()

uint32 SteamNetworkingMessage_t::GetSize ( ) const
inline

Definition at line 931 of file steamnetworkingtypes.h.

◆ GetTimeReceived()

SteamNetworkingMicroseconds SteamNetworkingMessage_t::GetTimeReceived ( ) const
inline

Definition at line 936 of file steamnetworkingtypes.h.

◆ Release()

void SteamNetworkingMessage_t::Release ( )
inline

You MUST call this when you're done with the object, to free up memory, etc.

Definition at line 1935 of file steamnetworkingtypes.h.

Member Data Documentation

◆ _pad1__

uint16 SteamNetworkingMessage_t::_pad1__

Definition at line 923 of file steamnetworkingtypes.h.

◆ m_cbSize

int SteamNetworkingMessage_t::m_cbSize

Size of the payload.

Definition at line 851 of file steamnetworkingtypes.h.

◆ m_conn

HSteamNetConnection SteamNetworkingMessage_t::m_conn

For messages received on connections: what connection did this come from? For outgoing messages: what connection to send it to? Not used when using the ISteamNetworkingMessages interface

Definition at line 856 of file steamnetworkingtypes.h.

◆ m_identityPeer

SteamNetworkingIdentity SteamNetworkingMessage_t::m_identityPeer

For inbound messages: Who sent this to us? For outbound messages on connections: not used. For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to?

Definition at line 861 of file steamnetworkingtypes.h.

◆ m_idxLane

uint16 SteamNetworkingMessage_t::m_idxLane

For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. For inbound messages, what lane was the message received on?

Definition at line 922 of file steamnetworkingtypes.h.

◆ m_nChannel

int SteamNetworkingMessage_t::m_nChannel

When using ISteamNetworkingMessages, the channel number the message was received on (Not used for messages sent or received on "connections")

Definition at line 906 of file steamnetworkingtypes.h.

◆ m_nConnUserData

int64 SteamNetworkingMessage_t::m_nConnUserData

For messages received on connections, this is the user data associated with the connection.

This is usually the same as calling GetConnection() and then fetching the user data associated with that connection, but for the following subtle differences:

  • This user data will match the connection's user data at the time is captured at the time the message is returned by the API. If you subsequently change the userdata on the connection, this won't be updated.
  • This is an inline call, so it's much faster.
  • You might have closed the connection, so fetching the user data would not be possible.

Not used when sending messages.

Definition at line 879 of file steamnetworkingtypes.h.

◆ m_nFlags

int SteamNetworkingMessage_t::m_nFlags

Bitmask of k_nSteamNetworkingSend_xxx flags. For received messages, only the k_nSteamNetworkingSend_Reliable bit is valid. For outbound messages, all bits are relevant

Definition at line 911 of file steamnetworkingtypes.h.

◆ m_nMessageNumber

int64 SteamNetworkingMessage_t::m_nMessageNumber

Message number assigned by the sender. This is not used for outbound messages. Note that if multiple lanes are used, each lane has its own message numbers, which are assigned sequentially, so messages from different lanes will share the same numbers.

Definition at line 889 of file steamnetworkingtypes.h.

◆ m_nUserData

int64 SteamNetworkingMessage_t::m_nUserData

Arbitrary user data that you can use when sending messages using ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage. (The callback you set in m_pfnFreeData might use this field.)

Not used for received messages.

Definition at line 918 of file steamnetworkingtypes.h.

◆ m_pData

void* SteamNetworkingMessage_t::m_pData

Message payload.

Definition at line 848 of file steamnetworkingtypes.h.

◆ m_pfnFreeData

void(*) SteamNetworkingMessage_t::m_pfnFreeData(SteamNetworkingMessage_t *pMsg)

Function used to free up m_pData. This mechanism exists so that apps can create messages with buffers allocated from their own heap, and pass them into the library. This function will usually be something like:

free( pMsg->m_pData );

Definition at line 897 of file steamnetworkingtypes.h.

◆ m_pfnRelease

void(*) SteamNetworkingMessage_t::m_pfnRelease(SteamNetworkingMessage_t *pMsg)

Function to used to decrement the internal reference count and, if it's zero, release the message. You should not set this function pointer, or need to access this directly! Use the Release() function instead!

Definition at line 902 of file steamnetworkingtypes.h.

◆ m_usecTimeReceived

SteamNetworkingMicroseconds SteamNetworkingMessage_t::m_usecTimeReceived

Local timestamp when the message was received Not used for outbound messages.

Definition at line 883 of file steamnetworkingtypes.h.


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