NullReferenceException on Sfs.KillConnection()

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Jochanan
Posts: 79
Joined: 11 May 2018, 09:12

NullReferenceException on Sfs.KillConnection()

Postby Jochanan » 21 Aug 2019, 11:51

As a part of our re-connecting alghoritm, we are killing current sfs connection and creating a new one, but sometimes, we get an exception:
NullReferenceException: Object reference not set to an instance of an object
Sfs2X.Bitswarm.BitSwarmClient.KillConnection () (at <9bfe5727c1e148feb52fa1397dabf0b5>:0)
Sfs2X.SmartFox.KillConnection () (at <9bfe5727c1e148feb52fa1397dabf0b5>:0)


Do you have any idea of the cause of the exception?
In a one occation, the server status was connecting when it thrown an exception, but i do not think that the exception is the correct behaviour.

C# API Version: 1.7.12
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: NullReferenceException on Sfs.KillConnection()

Postby Lapo » 21 Aug 2019, 12:52

Hi,
I would not use KillConnection() to close the current session. The method is there only for testing a forced disconnection in the context of the reconnection system.

To shut down the current session use SmartFox.Disconnect() instead.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 23 guests