SteamNetworkingSockets
public struct SteamNetworkingSockets: Sendable
Steamworks ISteamNetworkingSockets
Access via networkingSockets
through a SteamAPI
or SteamGameServerAPI
instance.
Topics
func acceptConnection(conn: HSteamNetConnection) -> Result
func acceptConnection(conn: HSteamNetConnection) -> Result
Steamworks ISteamNetworkingSockets::AcceptConnection()
Declaration
public func acceptConnection(conn: HSteamNetConnection) -> Result
func beginAsyncRequestFakeIP(numPorts: Int) -> Bool
func beginAsyncRequestFakeIP(numPorts: Int) -> Bool
func closeConnection(peer: HSteamNetConnection, reason: Int, debug: String?, enableLinger: Bool) -> Bool
func closeConnection(peer: HSteamNetConnection, reason: Int, debug: String?, enableLinger: Bool) -> Bool
Steamworks ISteamNetworkingSockets::CloseConnection()
Declaration
@discardableResult
public func closeConnection(
peer: HSteamNetConnection, reason: Int, debug: String?, enableLinger: Bool
) -> Bool
func closeListenSocket(socket: HSteamListenSocket) -> Bool
func closeListenSocket(socket: HSteamListenSocket) -> Bool
Steamworks ISteamNetworkingSockets::CloseListenSocket()
Declaration
@discardableResult
public func closeListenSocket(socket: HSteamListenSocket) -> Bool
func configureConnectionLanes(conn: HSteamNetConnection, lanePriorities: [Int], laneWeights: [UInt16]) -> Result
func configureConnectionLanes(conn: HSteamNetConnection, lanePriorities: [Int], laneWeights: [UInt16]) -> Result
Steamworks ISteamNetworkingSockets::ConfigureConnectionLanes()
Declaration
public func configureConnectionLanes(
conn: HSteamNetConnection, lanePriorities: [Int], laneWeights: [UInt16]
) -> Result
func connectByIPAddress(address: SteamNetworkingIPAddr, options: [SteamNetworkingConfigValue]) -> HSteamNetConnection
func connectByIPAddress(address: SteamNetworkingIPAddr, options: [SteamNetworkingConfigValue]) -> HSteamNetConnection
Steamworks ISteamNetworkingSockets::ConnectByIPAddress()
Declaration
public func connectByIPAddress(
address: SteamNetworkingIPAddr, options: [SteamNetworkingConfigValue]
) -> HSteamNetConnection
func connectP2P(identityRemote: SteamNetworkingIdentity, remoteVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamNetConnection
func connectP2P(identityRemote: SteamNetworkingIdentity, remoteVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamNetConnection
Steamworks ISteamNetworkingSockets::ConnectP2P()
Declaration
public func connectP2P(
identityRemote: SteamNetworkingIdentity, remoteVirtualPort: Int,
options: [SteamNetworkingConfigValue]
) -> HSteamNetConnection
func connectToHostedDedicatedServer(identityTarget: SteamNetworkingIdentity, remoteVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamNetConnection
func connectToHostedDedicatedServer(identityTarget: SteamNetworkingIdentity, remoteVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamNetConnection
Steamworks ISteamNetworkingSockets::ConnectToHostedDedicatedServer()
Declaration
public func connectToHostedDedicatedServer(
identityTarget: SteamNetworkingIdentity, remoteVirtualPort: Int,
options: [SteamNetworkingConfigValue]
) -> HSteamNetConnection
func createFakeUDPPort(fakeServerPort: Int) -> SteamNetworkingFakeUDPPort
func createFakeUDPPort(fakeServerPort: Int) -> SteamNetworkingFakeUDPPort
Steamworks ISteamNetworkingSockets::CreateFakeUDPPort()
Declaration
public func createFakeUDPPort(fakeServerPort: Int) -> SteamNetworkingFakeUDPPort
func createHostedDedicatedServerListenSocket(localVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
func createHostedDedicatedServerListenSocket(localVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
Steamworks ISteamNetworkingSockets::CreateHostedDedicatedServerListenSocket()
Declaration
public func createHostedDedicatedServerListenSocket(
localVirtualPort: Int, options: [SteamNetworkingConfigValue]
) -> HSteamListenSocket
func createListenSocketIP(address: SteamNetworkingIPAddr, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
func createListenSocketIP(address: SteamNetworkingIPAddr, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
Steamworks ISteamNetworkingSockets::CreateListenSocketIP()
Declaration
public func createListenSocketIP(
address: SteamNetworkingIPAddr, options: [SteamNetworkingConfigValue]
) -> HSteamListenSocket
func createListenSocketP2P(localVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
func createListenSocketP2P(localVirtualPort: Int, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
Steamworks ISteamNetworkingSockets::CreateListenSocketP2P()
Declaration
public func createListenSocketP2P(
localVirtualPort: Int, options: [SteamNetworkingConfigValue]
) -> HSteamListenSocket
func createListenSocketP2PFakeIP(fakePort: Int, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
func createListenSocketP2PFakeIP(fakePort: Int, options: [SteamNetworkingConfigValue]) -> HSteamListenSocket
Steamworks ISteamNetworkingSockets::CreateListenSocketP2PFakeIP()
Declaration
public func createListenSocketP2PFakeIP(
fakePort: Int, options: [SteamNetworkingConfigValue]
) -> HSteamListenSocket
func createPollGroup() -> HSteamNetPollGroup
func createPollGroup() -> HSteamNetPollGroup
Steamworks ISteamNetworkingSockets::CreatePollGroup()
Declaration
public func createPollGroup() -> HSteamNetPollGroup
func createSocketPair(useNetworkLoopback: Bool, identity1: SteamNetworkingIdentity?, identity2: SteamNetworkingIdentity?) -> (rc: Bool, connection1: HSteamNetConnection, connection2: HSteamNetConnection)
func createSocketPair(useNetworkLoopback: Bool, identity1: SteamNetworkingIdentity?, identity2: SteamNetworkingIdentity?) -> (rc: Bool, connection1: HSteamNetConnection, connection2: HSteamNetConnection)
Steamworks ISteamNetworkingSockets::CreateSocketPair()
Declaration
public func createSocketPair(
useNetworkLoopback: Bool, identity1: SteamNetworkingIdentity?,
identity2: SteamNetworkingIdentity?
) -> (
rc: Bool, connection1: HSteamNetConnection, connection2: HSteamNetConnection
)
func destroyPollGroup(pollGroup: HSteamNetPollGroup) -> Bool
func destroyPollGroup(pollGroup: HSteamNetPollGroup) -> Bool
Steamworks ISteamNetworkingSockets::DestroyPollGroup()
Declaration
@discardableResult
public func destroyPollGroup(pollGroup: HSteamNetPollGroup) -> Bool
func flushMessagesOnConnection(conn: HSteamNetConnection) -> Result
func flushMessagesOnConnection(conn: HSteamNetConnection) -> Result
Steamworks ISteamNetworkingSockets::FlushMessagesOnConnection()
Declaration
@discardableResult
public func flushMessagesOnConnection(conn: HSteamNetConnection) -> Result
func getAuthenticationStatus(returnDetails: Bool) -> (rc: SteamNetworkingAvailability, details: SteamNetAuthenticationStatus)
func getAuthenticationStatus(returnDetails: Bool) -> (rc: SteamNetworkingAvailability, details: SteamNetAuthenticationStatus)
Steamworks ISteamNetworkingSockets::GetAuthenticationStatus()
Declaration
public func getAuthenticationStatus(returnDetails: Bool = true) -> (
rc: SteamNetworkingAvailability, details: SteamNetAuthenticationStatus
)
func getCertificateRequest(blobSize: Int, returnBlob: Bool) -> (rc: Bool, blobSize: Int, blob: [UInt8], msg: String)
func getCertificateRequest(blobSize: Int, returnBlob: Bool) -> (rc: Bool, blobSize: Int, blob: [UInt8], msg: String)
func getConnectionInfo(conn: HSteamNetConnection) -> (rc: Bool, info: SteamNetConnectionInfo)
func getConnectionInfo(conn: HSteamNetConnection) -> (rc: Bool, info: SteamNetConnectionInfo)
Steamworks ISteamNetworkingSockets::GetConnectionInfo()
Declaration
public func getConnectionInfo(conn: HSteamNetConnection) -> (
rc: Bool, info: SteamNetConnectionInfo
)
func getConnectionName(peer: HSteamNetConnection, maxLen: Int) -> (rc: Bool, name: String)
func getConnectionName(peer: HSteamNetConnection, maxLen: Int) -> (rc: Bool, name: String)
Steamworks ISteamNetworkingSockets::GetConnectionName()
Declaration
public func getConnectionName(peer: HSteamNetConnection, maxLen: Int) -> (
rc: Bool, name: String
)
func getConnectionRealTimeStatus(conn: HSteamNetConnection, returnStatus: Bool, laneCount: Int, returnLaneStatus: Bool) -> (rc: Result, status: SteamNetConnectionRealTimeStatus, laneStatus: [SteamNetConnectionRealTimeLaneStatus])
func getConnectionRealTimeStatus(conn: HSteamNetConnection, returnStatus: Bool, laneCount: Int, returnLaneStatus: Bool) -> (rc: Result, status: SteamNetConnectionRealTimeStatus, laneStatus: [SteamNetConnectionRealTimeLaneStatus])
Steamworks ISteamNetworkingSockets::GetConnectionRealTimeStatus()
Declaration
public func getConnectionRealTimeStatus(
conn: HSteamNetConnection, returnStatus: Bool = true, laneCount: Int,
returnLaneStatus: Bool = true
) -> (
rc: Result, status: SteamNetConnectionRealTimeStatus,
laneStatus: [SteamNetConnectionRealTimeLaneStatus]
)
func getConnectionUserData(peer: HSteamNetConnection) -> Int
func getConnectionUserData(peer: HSteamNetConnection) -> Int
Steamworks ISteamNetworkingSockets::GetConnectionUserData()
Declaration
public func getConnectionUserData(peer: HSteamNetConnection) -> Int
func getDetailedConnectionStatus(conn: HSteamNetConnection, returnBuf: Bool, bufSize: Int) -> (rc: Int, buf: String)
func getDetailedConnectionStatus(conn: HSteamNetConnection, returnBuf: Bool, bufSize: Int) -> (rc: Int, buf: String)
Steamworks ISteamNetworkingSockets::GetDetailedConnectionStatus()
Declaration
public func getDetailedConnectionStatus(
conn: HSteamNetConnection, returnBuf: Bool = true, bufSize: Int
) -> (rc: Int, buf: String)
func getFakeIP(firstPort: Int) -> SteamNetworkingFakeIPResult
func getFakeIP(firstPort: Int) -> SteamNetworkingFakeIPResult
Steamworks ISteamNetworkingSockets::GetFakeIP()
Declaration
public func getFakeIP(firstPort: Int) -> SteamNetworkingFakeIPResult
func getHostedDedicatedServerPOPID() -> SteamNetworkingPOPID
func getHostedDedicatedServerPOPID() -> SteamNetworkingPOPID
Steamworks ISteamNetworkingSockets::GetHostedDedicatedServerPOPID()
Declaration
public func getHostedDedicatedServerPOPID() -> SteamNetworkingPOPID
func getHostedDedicatedServerPort() -> UInt16
func getHostedDedicatedServerPort() -> UInt16
Steamworks ISteamNetworkingSockets::GetHostedDedicatedServerPort()
Declaration
public func getHostedDedicatedServerPort() -> UInt16
func getIdentity() -> (rc: Bool, identity: SteamNetworkingIdentity)
func getIdentity() -> (rc: Bool, identity: SteamNetworkingIdentity)
Steamworks ISteamNetworkingSockets::GetIdentity()
Declaration
public func getIdentity() -> (rc: Bool, identity: SteamNetworkingIdentity)
func getListenSocketAddress(socket: HSteamListenSocket) -> (rc: Bool, address: SteamNetworkingIPAddr)
func getListenSocketAddress(socket: HSteamListenSocket) -> (rc: Bool, address: SteamNetworkingIPAddr)
Steamworks ISteamNetworkingSockets::GetListenSocketAddress()
Declaration
public func getListenSocketAddress(socket: HSteamListenSocket) -> (
rc: Bool, address: SteamNetworkingIPAddr
)
func getRemoteFakeIPForConnection(conn: HSteamNetConnection) -> (rc: Result, addr: SteamNetworkingIPAddr)
func getRemoteFakeIPForConnection(conn: HSteamNetConnection) -> (rc: Result, addr: SteamNetworkingIPAddr)
Steamworks ISteamNetworkingSockets::GetRemoteFakeIPForConnection()
Declaration
public func getRemoteFakeIPForConnection(conn: HSteamNetConnection) -> (
rc: Result, addr: SteamNetworkingIPAddr
)
func initAuthentication() -> SteamNetworkingAvailability
func initAuthentication() -> SteamNetworkingAvailability
Steamworks ISteamNetworkingSockets::InitAuthentication()
Declaration
@discardableResult
public func initAuthentication() -> SteamNetworkingAvailability
func receiveMessagesOnConnection(conn: HSteamNetConnection, maxMessages: Int) -> (rc: Int, messages: [SteamNetworkingMessage])
func receiveMessagesOnConnection(conn: HSteamNetConnection, maxMessages: Int) -> (rc: Int, messages: [SteamNetworkingMessage])
Steamworks ISteamNetworkingSockets::ReceiveMessagesOnConnection()
Declaration
public func receiveMessagesOnConnection(
conn: HSteamNetConnection, maxMessages: Int
) -> (rc: Int, messages: [SteamNetworkingMessage])
func receiveMessagesOnPollGroup(pollGroup: HSteamNetPollGroup, maxMessages: Int) -> (rc: Int, messages: [SteamNetworkingMessage])
func receiveMessagesOnPollGroup(pollGroup: HSteamNetPollGroup, maxMessages: Int) -> (rc: Int, messages: [SteamNetworkingMessage])
Steamworks ISteamNetworkingSockets::ReceiveMessagesOnPollGroup()
Declaration
public func receiveMessagesOnPollGroup(
pollGroup: HSteamNetPollGroup, maxMessages: Int
) -> (rc: Int, messages: [SteamNetworkingMessage])
func resetIdentity(identity: SteamNetworkingIdentity?)
func resetIdentity(identity: SteamNetworkingIdentity?)
Steamworks ISteamNetworkingSockets::ResetIdentity()
Declaration
public func resetIdentity(identity: SteamNetworkingIdentity?)
func runCallbacks()
func runCallbacks()
Steamworks ISteamNetworkingSockets::RunCallbacks()
Declaration
public func runCallbacks()
func sendMessageToConnection(conn: HSteamNetConnection, data: UnsafeRawPointer, dataSize: Int, sendFlags: SteamNetworkingSendFlags, returnMessageNumber: Bool) -> (rc: Result, messageNumber: Int)
func sendMessageToConnection(conn: HSteamNetConnection, data: UnsafeRawPointer, dataSize: Int, sendFlags: SteamNetworkingSendFlags, returnMessageNumber: Bool) -> (rc: Result, messageNumber: Int)
Steamworks ISteamNetworkingSockets::SendMessageToConnection()
Declaration
public func sendMessageToConnection(
conn: HSteamNetConnection, data: UnsafeRawPointer, dataSize: Int,
sendFlags: SteamNetworkingSendFlags, returnMessageNumber: Bool = true
) -> (rc: Result, messageNumber: Int)
func sendMessages(messages: [SteamNetworkingMessage], returnMessageNumberOrResult: Bool) -> [Int]
func sendMessages(messages: [SteamNetworkingMessage], returnMessageNumberOrResult: Bool) -> [Int]
Steamworks ISteamNetworkingSockets::SendMessages()
Declaration
public func sendMessages(
messages: [SteamNetworkingMessage], returnMessageNumberOrResult: Bool = true
) -> [Int]
func setCertificate(certificate: [UInt8]) -> (rc: Bool, msg: String)
func setCertificate(certificate: [UInt8]) -> (rc: Bool, msg: String)
func setConnectionName(peer: HSteamNetConnection, name: String)
func setConnectionName(peer: HSteamNetConnection, name: String)
Steamworks ISteamNetworkingSockets::SetConnectionName()
Declaration
public func setConnectionName(peer: HSteamNetConnection, name: String)
func setConnectionPollGroup(conn: HSteamNetConnection, pollGroup: HSteamNetPollGroup) -> Bool
func setConnectionPollGroup(conn: HSteamNetConnection, pollGroup: HSteamNetPollGroup) -> Bool
Steamworks ISteamNetworkingSockets::SetConnectionPollGroup()
Declaration
@discardableResult
public func setConnectionPollGroup(
conn: HSteamNetConnection, pollGroup: HSteamNetPollGroup
) -> Bool
func setConnectionUserData(peer: HSteamNetConnection, userData: Int) -> Bool
func setConnectionUserData(peer: HSteamNetConnection, userData: Int) -> Bool
Steamworks ISteamNetworkingSockets::SetConnectionUserData()
Declaration
@discardableResult
public func setConnectionUserData(peer: HSteamNetConnection, userData: Int)
-> Bool
func getCertificateRequest() -> (rc: Bool, blob: [UInt8], msg: String)
func getCertificateRequest() -> (rc: Bool, blob: [UInt8], msg: String)
func getDetailedConnectionStatus(conn: HSteamNetConnection) -> (rc: Int, buf: String)
func getDetailedConnectionStatus(conn: HSteamNetConnection) -> (rc: Int, buf: String)
Provided by module SteamworksHelpers
.
Steamworks ISteamNetworkingSockets::GetDetailedConnectionStatus()
Declaration
public func getDetailedConnectionStatus(conn: HSteamNetConnection) -> (
rc: Int, buf: String
)
func closeConnection(peer: HSteamNetConnection, reason: SteamNetConnectionEnd, debug: String?, enableLinger: Bool) -> Bool
func closeConnection(peer: HSteamNetConnection, reason: SteamNetConnectionEnd, debug: String?, enableLinger: Bool) -> Bool
Provided by module SteamworksHelpers
.
Steamworks ISteamNetworkingSockets::CloseConnection()
– for built-in end-reasons
Declaration
@discardableResult
public func closeConnection(
peer: HSteamNetConnection, reason: SteamNetConnectionEnd, debug: String?,
enableLinger: Bool
) -> Bool