Page 1 of 1

question about thread safty.

Posted: 18 Oct 2010, 09:32
by yakir22
I want to handle the login process from a different thread than the system handler.
I am going to have in the thread function something like :

User usr = ExtensionHelper.instance().canLogin(userName, pass, chan,this.getOwnerZone(),true);
ActionscriptObject res = new ActionscriptObject();
res.put("_cmd", "logOK");
sendResponse(res, -1, null, userChannel);

my question is : are "canLogin" and "sendResponse" function are thread safe. I looked at the documention but there is nothing there about these specific functions.

Thanks
Yakir.

Posted: 18 Oct 2010, 18:46
by BigFIsh
See --> http://www.smartfoxserver.com/docs/docP ... Safety.htm


canLogin --> System Handler is responsible for handling default requests such as "createRoom", "joinRoom", "sendPublicMessage" etc...


sendResponse --> "The Event Writer on the right side of the diagram is responsible for writing data back to the clients, and works similarly to the input controllers: outgoing messages are piled up into the output queue and its worker threads will process them in order."