Hi,
In my application, the join room procedure consists of sending a add_user message to server and then, after few checks I call _server.joinroom().
i) The AS1 api says that the result of _server.joinroom() is a boolean.
If the process fails and the boolean result is false, will the client get an
onJoinRoomError event or I have to explicitly send the message?
ii) What if an exception occurs when _server.joinroom() is called? I saw
that inside MainLib.as if a true/false value comes, the result is sent but
no result if an exception comes and is caught. Is it possible to catch the
exception inside AS code?
The reason for me asking this is that sometimes the client hangs after I send the add_user request. Although, I am handling the onJoinRoomError event but nothing happens when it hangs.
Thanks,
Rohit
Error handling while calling _server.joinRoom()
-
Rohit Sharma
- Posts: 31
- Joined: 05 Nov 2008, 05:27
- Location: Delhi,India
- Contact:
-
Rohit Sharma
- Posts: 31
- Joined: 05 Nov 2008, 05:27
- Location: Delhi,India
- Contact:
Sorry for the delay.
If the result is false, you will probably need to log the error. At least this will help you finding the possible cause.
Actually the only cause I can think of for a failure is a name collision, in other words when you try to create a Room with a name that already exists.
Yes, this is correct. Error messages are returned to the client just like when the request is sent from client side.i) The AS1 api says that the result of _server.joinroom() is a boolean.
If the process fails and the boolean result is false, will the client get an
onJoinRoomError event or I have to explicitly send the message?
_server.joinRoom does not fire any exceptions.ii) What if an exception occurs when _server.joinroom() is called? I saw
that inside MainLib.as if a true/false value comes, the result is sent but
no result if an exception comes and is caught. Is it possible to catch the
exception inside AS code?
If the result is false, you will probably need to log the error. At least this will help you finding the possible cause.
Actually the only cause I can think of for a failure is a name collision, in other words when you try to create a Room with a name that already exists.