.net Communication Events

Post here your suggestions for new possible features in SmartFoxServer 2X.

Moderators: Lapo, Bax

Zanpher
Posts: 96
Joined: 05 Oct 2009, 23:15

.net Communication Events

Postby Zanpher » 12 Oct 2012, 15:52

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?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: .net Communication Events

Postby Lapo » 02 Nov 2012, 10:43

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
Lapo
--
gotoAndPlay()
...addicted to flash games
Zanpher
Posts: 96
Joined: 05 Oct 2009, 23:15

Re: .net Communication Events

Postby Zanpher » 05 Nov 2013, 04:28

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?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: .net Communication Events

Postby Lapo » 05 Nov 2013, 09:06

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
Lapo

--

gotoAndPlay()

...addicted to flash games
Zanpher
Posts: 96
Joined: 05 Oct 2009, 23:15

Re: .net Communication Events

Postby Zanpher » 05 Nov 2013, 23:57

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 ....

Return to “2X Features Wish List”

Who is online

Users browsing this forum: No registered users and 20 guests