Problems shutting down Unity OSX client

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

Moderators: Lapo, Bax

amateur
Posts: 29
Joined: 07 Jun 2017, 07:18

Problems shutting down Unity OSX client

Postby amateur » 31 Aug 2021, 12:46

I have recently been having difficulties with MacOS clients appearing to crash when closing the app. This happens most with Macs on the BigSur update, I think.

A quick way to demonstrate is with the "SFS2X Connector Example." If you attempt to connect to a server which isn't listening on 9933, it will show "Now connecting..." for several seconds. If you close the app while it is trying to connect, it looks like the app is frozen (hourglass, inactive window displayed etc). If instead you wait for it to fail to connect, it closes normally.

What should happen (as it does on Windows) is the app should close anyway.

Of course normally you would connect properly to the correct server - but the above behaviour can happen in other shutdown circumstances, this is just the easiest one to demonstrate.

I should point out that the version of SmartFox (client or server) makes no difference. It's possible something has changed on Macs and networking but I can't seem to find a way to pin it down or work around it. What I do know is if I attempt to connect to SmartFox it freezes on shutdown, and if I don't then is shuts down fine. It seems to need to finish the timeout before it will let the application close.

Note this only happens on socket connections - web sockets are fine.

Thanks
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problems shutting down Unity OSX client

Postby Lapo » 31 Aug 2021, 14:12

Hi,
if you're talking about an app created in Unity and built for macOS I don't think there's much we can do about it, since whatever happens at shutdown is happening in native code, which we (or you) can't control.

Historically this has been an issue on various platforms, i.e. closing the application while a connection is still active used to cause a crash in a specific environment. When possible we have tried to address it and generally speaking we've always recommended to close the active connection before shutting down the client.

In this specific case I don't think we have much control over what is happening. In any case do you have a native stack trace of the crash when you close the application?

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

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 35 guests