how could i get the message from the server side

59 views
Skip to first unread message

icantgo Wang

unread,
Jan 30, 2013, 9:08:57 AM1/30/13
to openrtmf...@googlegroups.com
hi,i have write the server side function code with lua. my flex code call lua function and get the result infomation.
how could flex get the lua result info? can anybody help me? thx.
my demo code
server side code with lua
function onConnection(client,checkcode)
        if (not (checkcode == "888888")) then
assert(false,"invalid code!");
end
end

client side code with flex

_connection = new NetConnection();
_connection.addEventListener(NetStatusEvent.NET_STATUS, connectionHandler);
try
{
_connection.connect(protocol + _host + "/" + _application, _user, _meeting,_pwd);
}
catch (e:Error)
{
//i want get the error message from lua code ,but when i debug the flex code , server side had raised the error,but the flex get nothing.why?
}

cumulus dev

unread,
Jan 30, 2013, 10:52:53 AM1/30/13
to openrtmf...@googlegroups.com
You can't try/catch the "NetConnection::connect" function on client side, as every AS3 call, it's an async call. You manage your connection (success or error) with your connectionHandler event, of course.

Here you call "NetConnection::connect" with 3 parameters (user, meeting, pwd), so on server side, you should write:

function onConnection(client,user,meeting,pwd)
end

And finally, to reject the new client with an error message, look:
page, the "onConnection" event description, you have a exact sample for your case (in using "error" LUA function).


2013/1/30 icantgo Wang <chengd...@gmail.com>

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes OpenRTMFP Cumulus.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse openrtmfp-cumu...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 

icantgo Wang

unread,
Feb 2, 2013, 7:55:39 AM2/2/13
to openrtmf...@googlegroups.com
thanks a lot. i have fixed the bug.

在 2013年1月30日星期三UTC+8下午10时08分57秒,icantgo Wang写道:
Reply all
Reply to author
Forward
0 new messages