Cannot invoke method on primary FlowWriter

12 views
Skip to first unread message

phsultan

unread,
May 23, 2013, 4:09:15 PM5/23/13
to openrtmf...@googlegroups.com
Hi all,

I need to invoke a method on the client that is connecting to Cumulus. However, it looks like I cannot use the primary FlowWriter to do so, and have to create a new one before invoking a method.

That is, this code does not work (method not invoked on the client) :
function onConnection(client,...)
  NOTE("client connected ")
  client.writer:writeAMFMessage("connected","hello")
  client.writer:flush(true)
end

Whereas this code works (method "connected" called on the remote client) :
function onConnection(client,...)
  writer = client.writer:newFlowWriter()
  writer:writeAMFMessage("connected","hello")
end

Also, sending a response to the client upon connection works fine :
function onConnection(client,...)
  return {message="welcome",id=1}
end

Is there something I've missed or done wrong?

Thanks a lot for this great software,

Philippe
Reply all
Reply to author
Forward
0 new messages