Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Defer accept/reject of RTMP client?

  1. Default Defer accept/reject of RTMP client?

    I have a use case where I'd like to make an asynchronous remoting call and receive results before I process RTMP clients. While I'm waiting for the response from the remoting request, I'd like to defer handling of RTMP connections, as I'll need the data from the remoting call to make logical decisions.

    I find that I can store references to the IClient objects in a map, but if I don't invoke acceptConnection or rejectConnection on a client object in a module's onConnect method, Wowza will invoke acceptConnection for me (I assume there is a handler in ModuleBase that's doing this for me).

    Is there a way to prevent this behavior, and just leave my IClients in my map until I'm ready to deal with them?

    Thanks,
    Jay

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

    Default

    Jay,

    Not sure if it is enough, but you can set the Application.xml /Connections /AutoAccept to "false"

    Richard

  3. Default

    Thanks Richard. I'll give that a try.

    I found the IApplicationInstance.setAcceptConnection() method, but that seems to have no effect. Is that supposed to work as well?

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

    Default

    That should work. I think if you set that in a client context it will affect all others, at least till the app is unloaded. So do it in onAppStart

    Richard

  5. Default

    Well, I tried both methods... setting appInstance.setAcceptConnection(false) in my onAppStart, and setting the value in application.xml, but neither seem to work. The client is accepted as soon as the onConnect method returns (the access log confirms)

    Any other ideas or input on this one?

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

    Default

    hm, setting AutoConnect to "false" should be all you need. It works in my test.

    Richard

  7. Default

    Ok... after adding a class that implements IClientNotify, I see that Wowza is actually rejecting the connection, not accepting it. The access log is a little misleading... it logs an entry with an x-event of connect-session.

    But, that's not really the behavior I'm looking for. What I need is to neither accept nor reject the client in the onConnect method. In the onconnect, I need to move the client into a queue and wait for a remoting response before I accept or reject the connection, which I handle in a method invoked after the remoting response comes in.

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

    Default

    The only way I can suggest is while loop in onConnect. This kind of thing is not recommended, you know. What about offloading to the client somehow? Validate before netconnection.connect()

    Richard

  9. Default

    Yeah... loops or sleep in the onconnect have brought me problems before, especially on busy servers.

    Unfortunately, I can't offload the issue to the client, as I don't control the encoders (could be any encoder really).

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

    Default

    Jay,

    There is nothing built-in. I will ask around for ideas....

    Richard

Page 1 of 2 12 LastLast

Similar Threads

  1. Server reject error
    By ROTIMI in forum General Forum
    Replies: 2
    Last Post: 02-24-2014, 08:53 AM
  2. reject client play method
    By asaf32 in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 05-23-2013, 06:26 AM

Posting Permissions

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