Clients are billed for the time they are connected to our service using a flash client, therefore our Wowza module keeps an eye on how much they have spent so far, in the case that they exceed their spending limit we want to disconnect the client from the live stream. However there we have an issue telling the client in a nice way they have been disconnected, here is what we have tried:
1. Call client.rejectConnection which should raise the generic NET_STATUS event on the flash NetConnection object with the code "NetConnection.Connect.Rejected", this works fine in the onConnect handler on the module but after accepting the connection you can't seem to reject it later on.
2. The other alternative is adding client side handler to do the closing, i seen this recommended by wowza support previously as being the solution but its unacceptable to leave this kind of access control to the client as this is easily circumvented, so this is not an option as the only solution.
3. The last method we tried is to call a client side handler that notifies the user that he is disconnected and then straight after calling client.setShutdownClient(true) however doing this the client.call("NotifyOfDisconnect", null, "parameter") call seem to be ignored and the client is never notified. I assume we could solve this by using a delay on the setShutDownClient but that just seems wrong and will take up unnecessary resources.
What is the recommendation in a case like this?