Class QosDiscovery
Namespace: Unity.Networking.QoS
Syntax
public class QosDiscovery
Constructors
QosDiscovery(String)
Declaration
public QosDiscovery(string fleetId)
Parameters
Type | Name | Description |
---|---|---|
String | fleetId |
Properties
DiscoveryServiceUri
The pattern for building the URI to the discovery service. For use in a formatter; replace your Fleet ID with {0} and set the FleetId separately using the FleetId property.
Declaration
public string DiscoveryServiceUri { get; set; }
Property Value
Type | Description |
---|---|
String |
ErrorString
Populated with an error if the request has failed
Declaration
public string ErrorString { get; }
Property Value
Type | Description |
---|---|
String |
FailureCacheTimeMs
The time (in milliseconds) to cache a failure state
Declaration
public int FailureCacheTimeMs { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
FleetId
The ID of your multiplay fleet
Declaration
public string FleetId { get; set; }
Property Value
Type | Description |
---|---|
String |
IsDone
Whether or not the qos request is in a "done" state (success or failure)
Declaration
public bool IsDone { get; }
Property Value
Type | Description |
---|---|
Boolean |
OnError
The callback to invoke when a call to the discovery service fails
Declaration
public Action<string> OnError { get; set; }
Property Value
Type | Description |
---|---|
Action<String> |
OnSuccess
The callback to invoke when a call to the discovery service is successful
Declaration
public Action<QosServer[]> OnSuccess { get; set; }
Property Value
Type | Description |
---|---|
Action<QosServer[]> |
QosServers
Get a new copy of the cached QosServers
Declaration
public QosServer[] QosServers { get; }
Property Value
Type | Description |
---|---|
QosServer[] |
RequestRetries
The number of request retries performed in the event of a failure.
Declaration
public int RequestRetries { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
RequestTimeoutSeconds
The time (in seconds) to wait before timing out a single call to the discovery service.
Declaration
public int RequestTimeoutSeconds { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
State
The internal state of the qos request
Declaration
public DiscoveryState State { get; }
Property Value
Type | Description |
---|---|
DiscoveryState |
SuccessCacheTimeMs
The time (in milliseconds) to cache a set of successful results. Can be overridden by cache-control information received from the service.
Declaration
public int SuccessCacheTimeMs { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Cancel()
Cancel the current in-progress or completed discovery
Declaration
public void Cancel()
Remarks
- Clears the UnityWebRequestAsyncOperation, all callbacks, and sets the state back to NotStarted.
- Leaves the cache/etag values so starting a new discovery can take advantage of those values.
Reset()
Cancel the current in-progress or completed discovery with cache disposal
Declaration
public void Reset()
Remarks
- Does everything Cancel() does, plus purges the cache
Start(Action<QosServer[]>, Action<String>)
Starts the QoS server discovery process
Declaration
public void Start(Action<QosServer[]> successHandler = null, Action<string> errorHandler = null)
Parameters
Type | Name | Description |
---|---|---|
Action<QosServer[]> | successHandler | |
Action<String> | errorHandler |
Remarks
- QosDiscovery is not thread safe and does not support concurrent Discovery requests. Calling Start while another discovery is outstanding will cancel the existing request and not trigger handlers.