Table of Contents

Class SteamFactory<TRoot>

Namespace
MarymoorStudios.Core.Steamworks.Rpc
Assembly
MarymoorStudios.Core.Steamworks.Rpc.dll

Establishes a scope for incoming and outgoing Steam Networking Sockets based channels.

public sealed class SteamFactory<TRoot> : IPromiseDisposable where TRoot : AServer<TRoot>

Type Parameters

TRoot

The type of the root object exposed on all connection (incoming and outgoing) within the scope of this factory.

Inheritance
SteamFactory<TRoot>
Implements
Inherited Members

Remarks

Enables the creation of incoming listeners for receiving network connections from remote parties using Steam Networking Sockets.

Enables the establishment of outgoing connections to remote parties using Steam Networking Sockets.

A SteamFactory<TRoot> instance represents a set of such incoming and outgoing connections that can be torn down collectively (by disposing the factory instance).

Methods

Connect<TProxy, TServer>(CSteamID, int, CancellationToken)

Create a new outgoing connection within this Steam scope.

public TProxy Connect<TProxy, TServer>(CSteamID peer, int localVirtualPort = 0, CancellationToken cancel = default) where TProxy : Proxy<TServer>, IProxy<TProxy, TServer> where TServer : AServer<TServer>

Parameters

peer CSteamID

The steam id of the peer to connect to.

localVirtualPort int

The 0-based index of the virtual port to use.

cancel CancellationToken

A (optional) cancellation that can be used to terminate this connection independently of the rest of the Steam scope.

Returns

TProxy

The remote root

Type Parameters

TProxy

The type of the expected remote root.

TServer

The server type of TProxy.

Connect<TProxy, TServer>(IPEndPoint, CancellationToken)

Create a new outgoing connection within this Steam scope.

public TProxy Connect<TProxy, TServer>(IPEndPoint endpoint, CancellationToken cancel = default) where TProxy : Proxy<TServer>, IProxy<TProxy, TServer> where TServer : AServer<TServer>

Parameters

endpoint IPEndPoint

The remote endpoint to connect to.

cancel CancellationToken

A (optional) cancellation that can be used to terminate this connection independently of the rest of the Steam scope.

Returns

TProxy

The remote root

Type Parameters

TProxy

The type of the expected remote root.

TServer

The server type of TProxy.

DisposeAsync()

public Promise DisposeAsync()

Returns

Promise

Listen(IPEndPoint)

Create a new incoming listening endpoint for this Steam scope.

public Promise<SteamListener> Listen(IPEndPoint endpoint)

Parameters

endpoint IPEndPoint

The endpoint on which to listen.

Returns

Promise<SteamListener>

Resolves to a SteamListener for controlling the lifetime of the listening endpoint.

ListenFakeIp(int)

Create a new incoming listening endpoint for this Steam scope.

public Promise<SteamListener> ListenFakeIp(int indexFakePort = 0)

Parameters

indexFakePort int

The 0-based index of the FakeIP to use.

Returns

Promise<SteamListener>

Resolves to a SteamListener for controlling the lifetime of the listening endpoint.

Remarks

The FakeIP MUST have been previously allocated.

ListenP2P(int)

Create a new incoming listening endpoint for this Steam scope.

public Promise<SteamListener> ListenP2P(int localVirtualPort = 0)

Parameters

localVirtualPort int

The 0-based index of the virtual port to use.

Returns

Promise<SteamListener>

Resolves to a SteamListener for controlling the lifetime of the listening endpoint.