Struct SteamIPAddress_t
An IPv4 or IPv6 address, as defined in steamtypes.h. m_eType indicates which is valid. Read and write the IPv6 bytes with GetIPv6() and SetIPv6(byte[]).
Inherited Members
Namespace: Unity.Steamworks.Interop
Assembly: Unity.Steamworks.Interop.dll
Syntax
[Serializable]
public struct SteamIPAddress_t
Fields
m_eType
Whether the address is IPv4 or IPv6.
Declaration
public ESteamIPType m_eType
Field Value
| Type | Description |
|---|---|
| ESteamIPType |
m_unIPv4
IPv4 address in host order (127.0.0.1 is 0x7f000001); valid when m_eType is k_ESteamIPTypeIPv4.
Declaration
public uint m_unIPv4
Field Value
| Type | Description |
|---|---|
| uint |
Methods
GetIPv6()
Copies out the IPv6 address; meaningful when m_eType is k_ESteamIPTypeIPv6.
Declaration
public byte[] GetIPv6()
Returns
| Type | Description |
|---|---|
| byte[] | A new 16-byte array, in network order. |
IPv4Any()
The IPv4 "any" address (0.0.0.0).
Declaration
public static SteamIPAddress_t IPv4Any()
Returns
| Type | Description |
|---|---|
| SteamIPAddress_t | An IPv4-typed address with every byte zero. |
IPv4Loopback()
The IPv4 loopback address (127.0.0.1).
Declaration
public static SteamIPAddress_t IPv4Loopback()
Returns
| Type | Description |
|---|---|
| SteamIPAddress_t | An IPv4-typed address holding 0x7f000001. |
IPv6Any()
The IPv6 "any" address (::).
Declaration
public static SteamIPAddress_t IPv6Any()
Returns
| Type | Description |
|---|---|
| SteamIPAddress_t | An IPv6-typed address with every byte zero. |
IPv6Loopback()
The IPv6 loopback address (::1).
Declaration
public static SteamIPAddress_t IPv6Loopback()
Returns
| Type | Description |
|---|---|
| SteamIPAddress_t | An IPv6-typed address whose last byte is 1. |
IsSet()
Whether an address has been assigned.
Declaration
public bool IsSet()
Returns
| Type | Description |
|---|---|
| bool | true when the IPv4 address, or for IPv6 any of its 16 bytes, is non-zero. |
SetIPv6(byte[])
Assigns an IPv6 address and sets the type to IPv6.
Declaration
public void SetIPv6(byte[] address)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | address | The 16 address bytes, in network order. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|