Struct steamworks_sys::SteamNetworkingMessage_t[][src]

#[repr(C)]pub struct SteamNetworkingMessage_t {
    pub m_pData: *mut c_void,
    pub m_cbSize: c_int,
    pub m_conn: HSteamNetConnection,
    pub m_identityPeer: SteamNetworkingIdentity,
    pub m_nConnUserData: int64,
    pub m_usecTimeReceived: SteamNetworkingMicroseconds,
    pub m_nMessageNumber: int64,
    pub m_pfnFreeData: Option<unsafe extern "C" fn(pMsg: *mut SteamNetworkingMessage_t)>,
    pub m_pfnRelease: Option<unsafe extern "C" fn(pMsg: *mut SteamNetworkingMessage_t)>,
    pub m_nChannel: c_int,
    pub m_nFlags: c_int,
    pub m_nUserData: int64,
}

A message that has been received.

Fields

m_pData: *mut c_void

Message payload

m_cbSize: c_int

Size of the payload.

m_conn: HSteamNetConnection

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

m_identityPeer: SteamNetworkingIdentity

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?

m_nConnUserData: int64

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,

m_usecTimeReceived: SteamNetworkingMicroseconds

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

m_nMessageNumber: int64

Message number assigned by the sender. This is not used for outbound messages

m_pfnFreeData: Option<unsafe extern "C" fn(pMsg: *mut SteamNetworkingMessage_t)>

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 );

m_pfnRelease: Option<unsafe extern "C" fn(pMsg: *mut SteamNetworkingMessage_t)>

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!

m_nChannel: c_int

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

m_nFlags: c_int

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

m_nUserData: int64

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.