Struct SteamNetworkingMessage_t
A network message. Message objects always live in native memory and are handed out as pointers (e.g. by ReceiveMessagesOnConnection(HSteamNetConnection, IntPtr[], int)). Read one with FromIntPtr(IntPtr), and pass the original pointer to Release(IntPtr) when finished. Every message must be released.
Inherited Members
Namespace: Unity.Steamworks.Interop
Assembly: Unity.Steamworks.Interop.dll
Syntax
[Serializable]
public struct SteamNetworkingMessage_t
Fields
_pad1__
Padding from the C++ declaration; carries no value.
Declaration
public ushort _pad1__
Field Value
| Type | Description |
|---|---|
| ushort |
m_cbSize
Payload size in bytes.
Declaration
public int m_cbSize
Field Value
| Type | Description |
|---|---|
| int |
m_conn
Received on a connection: the connection it came from. Outgoing: the connection to send to. Unused with SteamNetworkingMessages.
Declaration
public HSteamNetConnection m_conn
Field Value
| Type | Description |
|---|---|
| HSteamNetConnection |
m_identityPeer
Received: the sender. Outgoing through SteamNetworkingMessages: the recipient. Unused for outgoing messages on connections.
Declaration
public SteamNetworkingIdentity m_identityPeer
Field Value
| Type | Description |
|---|---|
| SteamNetworkingIdentity |
m_idxLane
Outgoing: the lane to send on. Received: the lane it arrived on. See ConfigureConnectionLanes(HSteamNetConnection, int, int[], ushort[]).
Declaration
public ushort m_idxLane
Field Value
| Type | Description |
|---|---|
| ushort |
m_nChannel
With SteamNetworkingMessages, the channel the message arrived on. Unused for connections.
Declaration
public int m_nChannel
Field Value
| Type | Description |
|---|---|
| int |
m_nConnUserData
Received on a connection: the connection's user data as of when the API returned the message, so it is still available after the connection closes. Unused when sending.
Declaration
public long m_nConnUserData
Field Value
| Type | Description |
|---|---|
| long |
m_nFlags
Bitmask of k_nSteamNetworkingSend_xxx flags. On received messages only the reliable bit is meaningful.
Declaration
public int m_nFlags
Field Value
| Type | Description |
|---|---|
| int |
m_nMessageNumber
The sender's message number. Numbering is sequential per lane, so messages on different lanes share numbers. Unused for outgoing messages.
Declaration
public long m_nMessageNumber
Field Value
| Type | Description |
|---|---|
| long |
m_nUserData
Application-defined data for a message sent with AllocateMessage(int); the m_pfnFreeData function may use it. Unused for received messages.
Declaration
public long m_nUserData
Field Value
| Type | Description |
|---|---|
| long |
m_pData
The payload, in native memory.
Declaration
public IntPtr m_pData
Field Value
| Type | Description |
|---|---|
| IntPtr |
m_pfnFreeData
Native function that frees m_pData, so an outgoing message can carry a buffer from a custom allocator.
Declaration
public IntPtr m_pfnFreeData
Field Value
| Type | Description |
|---|---|
| IntPtr |
m_usecTimeReceived
Local time the message was received. Unused for outgoing messages.
Declaration
public SteamNetworkingMicroseconds m_usecTimeReceived
Field Value
| Type | Description |
|---|---|
| SteamNetworkingMicroseconds |
Methods
FromIntPtr(IntPtr)
Copies a native message's fields into a managed struct. The copy owns nothing:
m_pData points into native memory that stays valid only until
pMsg is released with Release(IntPtr).
Declaration
public static SteamNetworkingMessage_t FromIntPtr(IntPtr pMsg)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | pMsg | The native |
Returns
| Type | Description |
|---|---|
| SteamNetworkingMessage_t | A snapshot of the message's fields. |
Release(IntPtr)
Releases a native message. Every message must be released exactly once. It takes the native pointer because the reference count lives in native memory, not in a managed copy.
Declaration
public static void Release(IntPtr pMsg)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | pMsg | The native |