Page 1 of 1
simple handleRequest question
Posted: 05 Jan 2011, 12:16
by miguelportilla
Is it possible that the params 'command' or 'params' in handleRequest( String command, String[] params, User user, int roomId ) ever be null?
I know that in SFSX2 these could never be null but how about in SFS?
Thanks.
Posted: 05 Jan 2011, 21:59
by BigFIsh
Not sure, but you should be able to test this yourself - for example,
smartFox.sendXtMessage("extName", null, null); (where the second and third parameters are command and params respectively).
and see how the server or client SFS API handles this.
tried...
Posted: 06 Jan 2011, 12:55
by miguelportilla
Thanks for your suggestion, BigFIsh.
Here are my findings calling sendXtMessage ( specifying type string for the fourth param )..
If 'command' or 'params' is null, the client will crash. This happens because sendXtMessage tries to deference a null object.
So the answer to my questions seems to be that 'command' or 'params' can never be null on the server receiving end when using the raw string protocol. The client will crash and the message will simply never make it to the server.
The behavior isn't necessarily the same with other request handlers. For example I tested with the default ActionScript request handler and that allows a null 'params' which will equate to an empty object on the server side.