SteamNetworkingIPAddr
public struct SteamNetworkingIPAddr: Sendable
extension SteamNetworkingIPAddr: Equatable, CustomStringConvertible
Steamworks SteamNetworkingIPAddr
Topics
Fields
var isIPv6AllZeros: Bool
var isIPv6AllZeros: Bool
var isIPv4: Bool
var isIPv4: Bool
var isLocalHost: Bool
var isLocalHost: Bool
var ipv4: Int
var ipv4: Int
Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd). Returns 0 if IP is not mapped IPv4.
Declaration
public var ipv4: Int { get }
var ipv6: [UInt8]
var ipv6: [UInt8]
var port: UInt16
var port: UInt16
var fakeIPType: SteamNetworkingFakeIPType
var fakeIPType: SteamNetworkingFakeIPType
Classify address as FakeIP. Never returns k_ESteamNetworkingFakeIPType_Invalid
.
Declaration
public var fakeIPType: SteamNetworkingFakeIPType { get }
var isFakeIP: Bool
var isFakeIP: Bool
func toString(withPort: Bool) -> String
func toString(withPort: Bool) -> String
Initializers
init()
init()
An invalid address
Declaration
public init()
init(inaddrAnyPort: UInt16)
init(inaddrAnyPort: UInt16)
init(ipv4: Int, port: UInt16)
init(ipv4: Int, port: UInt16)
init(ipv6: [UInt8], port: UInt16)
init(ipv6: [UInt8], port: UInt16)
init?(addressAndPort: String)
init?(addressAndPort: String)
Parse an IP address and optional port. If a port is not present, it is set to 0.
Declaration
public init?(addressAndPort: String)
SteamNetworkingIPAddr
static func ==(lhs: SteamNetworkingIPAddr, rhs: SteamNetworkingIPAddr) -> Bool
static func ==(lhs: SteamNetworkingIPAddr, rhs: SteamNetworkingIPAddr) -> Bool
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values a
and b
, a == b
implies that a != b
is false
.
Declaration
public static func == (lhs: SteamNetworkingIPAddr, rhs: SteamNetworkingIPAddr)
-> Bool
Parameters
lhs |
A value to compare. |
rhs |
Another value to compare. |
var description: String
var description: String
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the String(describing:)
initializer. This initializer works with any type, and uses the custom description
property for types that conform to CustomStringConvertible
CustomStringConvertible
:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of p
to a string in the assignment to s
uses the Point
type’s description
property.
Declaration
public var description: String { get }