Set Network Properties Example for C++

HRESULT SetNetworkProperties(IltmsServer* server) 
{ 
   HRESULT hr; 
   CComPtr<IltmsNetworkProperties> props; 
 
   // retrieve a copy of the current network properties 
   hr = server->GetNetworkProperties(&props); 
   if(FAILED(hr)) 
      goto error; 
 
   // change the properties 
   hr = props->put_IPAddress(CComBSTR(L"0.0.0.0")); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_Port(6969); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_RTPPort(6970); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_OpenWindowsFirewall(VARIANT_TRUE); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_Authentication(ltmsAuthentication_None); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_UserName(CComBSTR(L"admin")); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_Password(CComBSTR(L"password")); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_Realm(CComBSTR(L"LTMS")); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_IdleTimeOut(70000); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_RTCPTimeOut(30000); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_ServerName(CComBSTR(L"LTMS/1.0")); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_RTSPEnable(VARIANT_TRUE); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_RTMPEnable(VARIANT_TRUE); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_HDSEnable(VARIANT_TRUE); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_SSFEnable(VARIANT_TRUE); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_DASHEnable(VARIANT_TRUE); 
   if(FAILED(hr)) 
      goto error; 
   hr = props->put_MediaFolder(CComBSTR(L"%ltmsMediaFolder%")); 
   if(FAILED(hr)) 
      goto error; 
 
   // copy the properties to the server 
   hr = server->SetNetworkProperties(props); 
   if(FAILED(hr)) 
      goto error; 
 
error: 
   return hr; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Media Streaming C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.