WebORB RTMP Server provides support for the following functionality: live video streaming, on-demand video and audio streaming, video and audio recording, remote shared objects, data push (client-side method invocation from the server). The RTMP protocol is natively supported by the Flash player and thus both Flash and Flex clients can leverage the functionality. Additionally, WebORB for .NET provides client-side RTMP support for native Java and .NET clients. The .NET clients include, desktop .NET applications as well as Silverlight and WIndows Phone applications.
WebORB RTMP server can run either as a standalone process (or Windows Service) or hosted in IIS. When hosted in IIS, WebORB RTMP server is an inherent part of the WebORB Server, therefore it does not need any additional assemblies or configuration files. By default the hosted RTMP server is started in Global.asax using the following code:
void Application_Start(object sender, EventArgs e)
{
try
{
// Initialize WebORB configuration before starting messaging server
Weborb.Config.ORBConfig config = new Weborb.Config.ORBConfig();
// Create Messaging server. 2037 is the port number, 500 is connection backlog
Weborb.Messaging.RTMPServer server = new Weborb.Messaging.RTMPServer( "default", 2037, 500, config );
// Start the messaging server
server.start();
// Store the server instance in the Application context, so it can be cleared out when application stops
Application[ "weborbMessagingServer" ] = server;
}
catch( Exception )
{
}
}
The server is automatically started with the ASP.NET application where WebORB is deployed. As a result, it is important to understand, that in order for the RTMP functionality to be available, an ASP.NET request must be sent to the application first. This can be achieved either manually by loading an ASPX page (for example, you can use the WebORB diagnostics page http://localhost/YOUR-ASP-NET-APP/weborb.aspx?diag), or it can be done programmatically from the client-side code by issuing a remoting invocation of a no-op method. Alternatively, the RTMP server can be started programmatically using the same code as shown above. The startup routine can be invoked using a remote method invocation.
It is also important to note that the RTMP messaging server is shut down when the ASP.NET application is recycled. The recycling can be caused by multiple factors. For example, a file is modified/added/deleted in the /bin folder of the ASP.NET application or a change is introduced to web.config. Additionally, application pool where the application runs can have its own recycling properties. WebORB includes special code in Global.asax which restarts the server when application is recycled. if you deploy WebORB in your own application, it is recommended to add the implementation of the Application_Start, Application_BeginRequest and Application_End methods to your own Global.asax.