StartServer Method

Summary
Starts the RTSP server listening on the specified port.
Syntax
C#
C++/CLI
public void StartServer( 
   int port 
) 
public: 
void StartServer(  
   int port 
)  

Parameters

port
The port on which to listen for incoming connections. The standard port address for RTSP servers is DefaultPort (554).

Remarks

This function turns the server live and makes it ready to begin listening for connections on the port indicated by  port. The IP address on which it will listen should have been specified prior to calling this method using TargetAddress.

The server will run until it is stopped using the StopServer method.

The source folders and all the other server setting should have been set prior to calling this method. See RTSPServer and Creating an RTSP Server for more information on the RTSP server settings.

The port should be available and not in use by another program (such as the Windows Media Player Network Sharing Service). Port values can be between 1 and 65535. If you choose a port number other than 554 it is recommended to use a port value above 1024. Doing so avoids conflicts with other programs that might be running on your server (many port values below 1024 are restricted for system use or for well-defined protocols such as 80 for HTTP and 554 for RTSP). For more information about running the Windows 8 RTSPServer demo, refer to Why Does Starting a Server on the Default RTSP Port Fail when I Run the Windows 8 RTSPServer Demo?

Example
C#
using Leadtools; 
using Leadtools.Multimedia; 
using LeadtoolsMultimediaExamples.Fixtures; 
 
 
RTSPServer _server = null; 
public void StartServer() 
{ 
   // create the server instance 
   _server = new RTSPServer(); 
   // specify c:\MyFiles as the source folder 
   _server.SetSourceFolder(0, @"c:\MyFiles"); 
   // will listen on 127.0.0.1 
   _server.TargetAddress = "127.0.0.1"; 
   // start listening on port 554 
   _server.StartServer(554); 
   // set the latency 
   _server.SetLiveLatency(-1, 0.7); 
} 
 
public void StopServer() 
{ 
   _server.StopServer(554); 
   _server.Dispose(); 
   _server = null; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Multimedia Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.