Page 1 of 1
.net Communication Events
Posted: 12 Oct 2012, 15:52
by Zanpher
Instead of having to run a loop to get events from the C# .net client library ... why not have the library automatically throw events like a other .net communication libraries?
Re: .net Communication Events
Posted: 02 Nov 2012, 10:43
by Lapo
Sorry for the delay in responding.
I don't think I fully understand your question, events under .Net don't require any loop. What are you referring to?
Thanks
Re: .net Communication Events
Posted: 05 Nov 2013, 04:28
by Zanpher
Ah, now it is my turn to apologize for replying so late (almost a year, eh?).
Instead of having the programmer poll in order to raise events. Why not have the library just raise events itself?
Re: .net Communication Events
Posted: 05 Nov 2013, 09:06
by Lapo
Of course, it just depends on which environment you are working in. That's why we added a
ThreadSafeMode property that you can set to turn on/off the polling system.
Environments such as Unity require to poll for events while regular .Net platform doesn't need that.
Just make sure to set that property to false when you instantiate the main API object. Like this:
Code: Select all
SmartFox sfs = new SmartFox();
sfs.ThreadSafeMode = false;
...
...
cheers
Re: .net Communication Events
Posted: 05 Nov 2013, 23:57
by Zanpher
I should be smacking myself on my head right now. Of course it's that simple! Ha!
Thanks for your help in this. I finally got some time to delve back into using pure c# on the client side, and events are working ....