stopVHost([vhost:String]) : Object
Stops a running virtual host. (The stopVHost() command cannot be used on the default virtual host.) After the virtual host stops, all applications are unloaded and all users are disconnected. The virtual host does not accept any requests until it has been restarted by means of the startVHost() method or until the server is restarted.
A String indicating the virtual host that you want to stop. To stop the virtual host to which you’re connected, omit this parameter.
To stop a different virtual host, specify vhost_name in the form adaptor_name/vhost_name. You must be a server administrator to stop a virtual host other than the one to which you’re connected.
If the call succeeds, the server sends a reply information object with a level property of status and a code property of NetConnection.Call.Success.
If the call fails, the server sends a reply information object with a level property of error and a code property of NetConnection.Admin.Command.Failed or a more specific value, if available. Some objects might also have a description property that contains a string describing the cause of the failure.
If the call succeeds, it returns XML with the following structure:<result> <level></level> <code></code> <timestamp></timestamp> </result>
If the call fails, it returns XML with the following structure:<result> <level></level> <code></code> <description></description> <timestamp></timestamp> </result>
The XML elements contain the same information as the Object properties returned in an RTMP/E call.
Note: The timestamp response over HTTP is formatted differently on Windows (9/23/2007 6:16:40 PM) and Linux (Sun 23 Sep 2007 06:16:40 PM IST).
The following example stops the virtual host tree.oak.com and then stops the virtual host tree.oak.com on the default adaptor.
nc_admin = new NetConnection(); nc_admin.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab"); /* Stop the vhost named tree.oak.com */ nc_admin.call("stopVHost", new onStopVHost(), "tree.oak.com"); /* Stop the vhost named tree.oak.com on the default adaptor */ nc_admin.call("stopVHost", new onStopVHost(), "_defaultRoot_/tree.oak.com");