Results 1 to 6 of 6

Thread: How Wowza processes nc.call from one client?

  1. #1
    Join Date
    Oct 2013
    Posts
    6

    Default How Wowza processes nc.call from one client?

    Hello,

    If AS client make 3 calls to one wowza module:

    nc.call('operation1');
    nc.call('operation2');
    nc.call('operation3');

    how wowza will process it?
    Within a queue - FIFO? Firstly operation1, after operation2
    Or those calls can be processed in parallel by different threads?

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Those calls would be fired about the same time. If some order should be observed, you'll want to implement a responder such that you can ensure one completes prior to the start of the second.

  3. #3
    Join Date
    Oct 2013
    Posts
    6

    Default

    Hmm, what do you mean by "about the same time"?
    Do you mean Wowza processes independently each of those calls, by dispatching the processing for different thread workers?

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    If you need to these to happen in a sequence, you should use a Responder, or at least a timer to stall so that they are staggered. If you use a Responder, Wowza will respond with sendResult() which is call the Responder for the netconnection.call() where you would do the next netconnection.call().

    If you just do 3 netconnection.call()s, the RTMP client will do them in sequence in the code, but for all intent and purpose they will be all at once. It might be hard to measure the difference in time server-side, or guarantee what order they are actually processed server-side

    A simple way to setup a Responder:

    var serverResponse:Object = new Object();
    secureResult.onResult = function(msg:String):void
    {
    	trace(msg);
    	nc.call("doSomethingElse");
    }
    nc.call("doSomething", new Responder(serverResponse.onResult), "data to send to the server"));
    To call server-side method:
    public void doSomething(IClient client, RequestFunction function,
    			AMFDataList params) {
    		getLogger().info("doSomething");
    		sendResult(client, params, "Hello Wowza");
    	}
    Richard

  5. #5
    Join Date
    Oct 2013
    Posts
    6

    Default

    Hello Richard,
    Thank you for your replay.

    I understood that I should use Responder to guarantee the right calls sequence.
    So can you confirm that internally, Wowza server uses a thread pool to process the requests from net connection.call?

    Basically, I'm wondering to make a module which will intercept my calls and guarantee the correct ordering in server side and not by client logic. I have tried to implement it using wait() and notifyAll() mechanism in Java. But my module seems block the processing of other workers, so I never receive a notifyAll signal from another Thread.

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    I don't think you will be able to ensure sequence server-side. You will have to do it in the client.

    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •