RTMP/E

 restartVHost([vhost:String]) : Object

HTTP

 http://www.example.com:1111/admin/restartVHost?auser=username&apswd=password[&vhost=vhost]

Restarts a virtual host that is currently running. Restarting a virtual host disconnects all connected users, unloads all currently loaded applications, and reloads the configuration files for that virtual host. For restartVHost() to work properly, there must be at least one application instantiated on the virtual host.

If you make changes to the configuration files for a virtual host, you can call this method to restart the virtual host without restarting the server.

Users must reconnect each time you restart a virtual host. Before calling this method, you might want to take steps to notify connected users.

Virtual host administrators can only restart the virtual hosts to which they are connected. You must be a server administrator to start a virtual host other than the one to which you’re connected.

Note:

To start a virtual host that is stopped, call the startVHost() method. You must be a server administrator to call this method.

Availability

Flash Communication Server 1.0.

Parameters

vhost

A String indicating which virtual host you want to restart.

To restart the virtual host to which you’re connected, omit this parameter.

To restart a different virtual host, specify the virtual host as adaptor_name/virtual_hostname.

auser

A String indicating the user name of the administrator.

apswd

A String indicating the password of the administrator.

Returns

RTMP/E

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.

HTTP

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).

Example

The following example shows a call to restart the connected virtual host and then a call to restart a specified virtual host tree.oak.com on the default adaptor:

 nc_admin = new NetConnection(); 
 nc_admin.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab"); 
  
 /* Restart the connected virtual host */ 
 nc_admin.call("restartVHost", new onRestartVHost()); 
  
 /* Restart the virtual host tree.oak.com on the default adaptor. */ 
 nc_admin.call("restartVHost", new onRestartVHost(), "_defaultRoot_/tree.oak.com");

See also

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy