SSLPort Property

Summary
Retrieves or sets the server's SSL port.
Syntax
C#
C++/CLI
public int SSLPort { get; set; } 
public: 
property int SSLPort { 
   int get(); 
   void set (    int ); 
} 

Property Value

The integer value indicating the server's SSL port.

Remarks

The default value is 0 (Indicates SSL streaming is disabled by default). Set to 0 to disable SSL (https secure) streaming. Setting it to a valid port > 0 enables SSL (https secure) streaming. The standard SSL port used for https streaming is 443. So to enable SSL streaming, you would typically set this port to either 443 or a value > 1024. If you enable SSL streaming by setting a SSL port > 0, you should also select a certificate using SSLCertificateStore and SSLCertificateHash.

Example
C#
using Leadtools; 
using Leadtools.MediaStreaming; 
 
 
 
public Server _server = null; 
public bool _result = false; 
 
public void PrintNetworkPropertiesExample() 
{ 
   try 
   { 
      string strNetworkProperties = ""; 
 
      // create an instance of the server object 
      _server = new Leadtools.MediaStreaming.Server(); 
 
      // retrieve a copy of the Network Properties 
      NetworkProperties props = _server.GetNetworkProperties(); 
 
 
      // print the Network Properties to a string 
 
      strNetworkProperties += "--- Network Properties ---\n\n"; 
 
      strNetworkProperties += string.Format("IPAddress = {0}\n", props.IPAddress); 
 
      strNetworkProperties += string.Format("ActualIPAddress = {0}\n", props.ActualIPAddress); 
 
      strNetworkProperties += string.Format("Port = {0}\n", props.Port.ToString()); 
 
      strNetworkProperties += string.Format("RTPPort = {0}\n", props.RTPPort.ToString()); 
 
      if (props.OpenWindowsFirewall) 
         strNetworkProperties += "OpenWindowsFirewall = true\n"; 
      else 
         strNetworkProperties += "OpenWindowsFirewall = false\n"; 
 
      switch (props.Authentication) 
      { 
         case Authentication.Basic: 
            strNetworkProperties += "Authentication = Basic\n"; 
            break; 
         case Authentication.Digest: 
            strNetworkProperties += "Authentication = Digest\n"; 
            break; 
         default: 
            strNetworkProperties += "Authentication = None\n"; 
            break; 
      } 
 
      strNetworkProperties += string.Format("UserName = \"{0}\"\n", props.UserName); 
 
      strNetworkProperties += string.Format("Password = \"{0}\"\n", props.Password); 
 
      strNetworkProperties += string.Format("Realm = \"{0}\"\n", props.Realm); 
 
      strNetworkProperties += string.Format("IdleTimeOut = {0}\n", props.IdleTimeOut.ToString()); 
 
      strNetworkProperties += string.Format("RTCPTimeOut = {0}\n", props.RTCPTimeOut.ToString()); 
 
      strNetworkProperties += string.Format("ServerName = \"{0}\"\n", props.ServerName); 
 
      if (props.RTSPEnable) 
         strNetworkProperties += "RTSPEnable = true\n"; 
      else 
         strNetworkProperties += "RTSPEnable = false\n"; 
 
      if (props.RTMPEnable) 
         strNetworkProperties += "RTMPEnable = true\n"; 
      else 
         strNetworkProperties += "RTMPEnable = false\n"; 
 
      if (props.HDSEnable) 
         strNetworkProperties += "HDSEnable = true\n"; 
      else 
         strNetworkProperties += "HDSEnable = false\n"; 
 
      if (props.SSFEnable) 
         strNetworkProperties += "SSFEnable = true\n"; 
      else 
         strNetworkProperties += "SSFEnable = false\n"; 
 
      if (props.DASHEnable) 
         strNetworkProperties += "DASHEnable = true\n"; 
      else 
         strNetworkProperties += "DASHEnable = false\n"; 
 
      strNetworkProperties += string.Format("MediaFolder = \"{0}\"\n", props.MediaFolder); 
 
      strNetworkProperties += string.Format("ResolvedMediaFolder = \"{0}\"\n", props.ResolvedMediaFolder); 
 
      strNetworkProperties += string.Format("SSLPort = \"{0}\"\n", props.SSLPort.ToString()); 
 
      byte[] hash = (byte[])props.SSLCertificateHash; 
      string strhash = ""; 
      if (hash.Length == 0) 
         strhash = "<empty>"; 
 
      for (int n = 0; n < hash.Length; n++) 
      { 
         strhash += hash[n].ToString(); 
      } 
 
      strNetworkProperties += string.Format("SSLCertificateHash = \"{0}\"\n", strhash); 
 
      strNetworkProperties += string.Format("SSLCertificateStore = \"{0}\"\n", props.SSLCertificateStore); 
 
      // display a message contains the Network Properties string 
      MessageBox.Show(strNetworkProperties, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 
      _result = true; 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
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.MediaStreaming Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.