Photon Unity Networking 2 2.45

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
ConnectionHandler Class Reference

Inherited by PhotonHandler.

Public Member Functions

void StartFallbackSendAckThread ()
 
void StopFallbackSendAckThread ()
 
bool RealtimeFallbackThread ()
 A thread which runs independent from the Update() calls. Keeps connections online while loading or in background. See KeepAliveInBackground. More...
 

Static Public Member Functions

static bool IsNetworkReachableUnity ()
 When run in Unity, this returns Application.internetReachability != NetworkReachability.NotReachable. More...
 

Public Attributes

bool DisconnectAfterKeepAlive = false
 Option to let the fallback thread call Disconnect after the KeepAliveInBackground time. Default: false. More...
 
int KeepAliveInBackground = 60000
 Defines for how long the Fallback Thread should keep the connection, before it may time out as usual. More...
 
bool ApplyDontDestroyOnLoad = true
 Keeps the ConnectionHandler, even if a new scene gets loaded. More...
 

Static Public Attributes

static bool AppQuits
 Indicates that the app is closing. Set in OnApplicationQuit(). More...
 
static bool AppPause
 
static bool AppPauseRecent
 
static bool AppOutOfFocus
 
static bool AppOutOfFocusRecent
 

Properties

LoadBalancingClient Client [get, set]
 Photon client to log information and statistics from. More...
 
int CountSendAcksOnly [get]
 Counts how often the Fallback Thread called SendAcksOnly, which is purely of interest to monitor if the game logic called SendOutgoingCommands as intended. More...
 
bool FallbackThreadRunning [get]
 True if a fallback thread is running. Will call the client's SendAcksOnly() method to keep the connection up. More...
 

Member Function Documentation

◆ IsNetworkReachableUnity()

static bool IsNetworkReachableUnity ( )
static

When run in Unity, this returns Application.internetReachability != NetworkReachability.NotReachable.

Returns
Application.internetReachability != NetworkReachability.NotReachable

◆ RealtimeFallbackThread()

bool RealtimeFallbackThread ( )

A thread which runs independent from the Update() calls. Keeps connections online while loading or in background. See KeepAliveInBackground.

Member Data Documentation

◆ ApplyDontDestroyOnLoad

bool ApplyDontDestroyOnLoad = true

Keeps the ConnectionHandler, even if a new scene gets loaded.

◆ AppQuits

bool AppQuits
static

Indicates that the app is closing. Set in OnApplicationQuit().

◆ DisconnectAfterKeepAlive

bool DisconnectAfterKeepAlive = false

Option to let the fallback thread call Disconnect after the KeepAliveInBackground time. Default: false.

If set to true, the thread will disconnect the client regularly, should the client not call SendOutgoingCommands / Service. This may happen due to an app being in background (and not getting a lot of CPU time) or when loading assets.

If false, a regular timeout time will have to pass (on top) to time out the client.

◆ KeepAliveInBackground

int KeepAliveInBackground = 60000

Defines for how long the Fallback Thread should keep the connection, before it may time out as usual.

We want to the Client to keep it's connection when an app is in the background (and doesn't call Update / Service Clients should not keep their connection indefinitely in the background, so after some milliseconds, the Fallback Thread should stop keeping it up.

Property Documentation

◆ Client

LoadBalancingClient Client
getset

Photon client to log information and statistics from.

◆ CountSendAcksOnly

int CountSendAcksOnly
get

Counts how often the Fallback Thread called SendAcksOnly, which is purely of interest to monitor if the game logic called SendOutgoingCommands as intended.

◆ FallbackThreadRunning

bool FallbackThreadRunning
get

True if a fallback thread is running. Will call the client's SendAcksOnly() method to keep the connection up.