any way to not lock while sending?

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

creat326
Posts: 86
Joined: 13 Jun 2010, 09:50

any way to not lock while sending?

Postby creat326 » 15 Sep 2010, 07:23

Hi

I'm having an issue with the unity package that i'm using in an iphone game. When I send a message to the server, the thread will lock until is done sending. Since iphone is not multitasking, it will lock the whole game for that period of time.

Is there a way to send information out without locking the whole game?

Regards,
Joaquin
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 15 Sep 2010, 07:42

Hey J,

Not had the problem myself. You must be spamming messages a lot to the server :-)

My games are turn based, so not been in a real time situation with SFS1 API

So some guesses/proposals:

Hmmm - you should be able to do the sending in a coroutine possibly in your game. Just because Unity itself is not threaded, doesnt mean you cannot "cheat" by making a coroutine (which work on iPhone very nicely).

Hack the API sources to make a thread to send. The point of the hack would be in SmartFoxClient.cs line 3938 WriteToSocket()

/Thomas

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 2 guests