Yes... my bad... should have thought of that before posting...
An example of a disconnect happens at line 8362. Right before the "websocket.jetty.WebSocketbinaryProtocolCodec" start message.
Thanks
Unity WebGL - SFS 2.13 - WebSockets disconnect
-
- Posts: 20
- Joined: 30 Aug 2017, 08:30
Re: Unity WebGL - SFS 2.13 - WebSockets disconnect
I've noticed that you cancel the scheduled task like this:
(in CRoom.cancelGame method)
Did you try not to halt the thread abruptly, passing false instead of true to the cancel method?
Code: Select all
loop.cancel(true);
(in CRoom.cancelGame method)
Did you try not to halt the thread abruptly, passing false instead of true to the cancel method?
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
- Posts: 20
- Joined: 30 Aug 2017, 08:30
Re: Unity WebGL - SFS 2.13 - WebSockets disconnect
No i haven't tested it I'll make the change and test the use cases out.
The CRoom.cancelGame method isn't called in the case of the WebGL disconnects. The CRoom.startGame is called, at line 949 after but i understand what you are saying.
The startGame method also uses the i will make the change sudgested and try again.
Thank you very much for taking the time to look into the code.
EDIT:
I just realized, you were talking about about the other case, where exiting both users at the same time would cause the webgl clients to get disconnected. Long day...
The CRoom.cancelGame method isn't called in the case of the WebGL disconnects. The CRoom.startGame is called, at line 949 after
Code: Select all
if(getTotalUsers() > 1)
The startGame method also uses the
Code: Select all
loop.cancel(true)
Thank you very much for taking the time to look into the code.
EDIT:
I just realized, you were talking about about the other case, where exiting both users at the same time would cause the webgl clients to get disconnected. Long day...
Re: Unity WebGL - SFS 2.13 - WebSockets disconnect
I wasn't referring to a specific case, because it is very hard to follow what your Extension does.
In any case we are not sure of the consequences of stopping a thread abruptly. There's a chance that some garbage remains in Jetty (which takes care of websocket communication) and when you send the next message an error is caused.
In any case we are not sure of the consequences of stopping a thread abruptly. There's a chance that some garbage remains in Jetty (which takes care of websocket communication) and when you send the next message an error is caused.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
- Posts: 20
- Joined: 30 Aug 2017, 08:30
Re: Unity WebGL - SFS 2.13 - WebSockets disconnect
That solved it.
Both the cases in which the WebGL clients were disconnected were solved just by passing false to loop.cancel(), on both Unity Editor and browser WebGL clients.
Thank you for all the help, I just can't believe I didn't catch the ideea to test this out, even after i read the tutorial on "How to schedule timed tasks in an Extension".
Again, thanks for all your help and time.
Fish.
Both the cases in which the WebGL clients were disconnected were solved just by passing false to loop.cancel(), on both Unity Editor and browser WebGL clients.
Thank you for all the help, I just can't believe I didn't catch the ideea to test this out, even after i read the tutorial on "How to schedule timed tasks in an Extension".
Again, thanks for all your help and time.
Fish.
Who is online
Users browsing this forum: Ronaldniff, Stevenor and 88 guests