Setting Login Server Information
SetServerAddress
API Description
This API is used to set login server information.
Precautions
- This API is optional. By default, the default login server address and port are used.
- This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.
Method Definition
HWM_SDK_AGENT_API hwmsdk::HwmErrCode SetServerAddress(const HwmServerInfo* serverInfo);
Callback Function
virtual void OnSetServerAddressResult(hwmsdk::HwmErrCode ret, const char* reason) {};
Parameter Description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
serverAddr |
No |
char[] |
Server address. The default value is meeting.huaweicloud.com. |
serverPort |
No |
unsigned short |
Server port. The default value is 443. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
/** * Set the login server information. */ void demoSetServerAddressDlg::SetServerAddress() { CString serverCString; CString portCString; m_serverEdit.GetWindowText(serverCString); m_portEdit.GetWindowText(portCString); hwmsdkagent::HwmServerInfo serverInfo{}; string server = CTools::UNICODE2UTF(serverCString.GetString()); strncpy_s(serverInfo.serverAddr, server.c_str(), HWM_MAX_URL_LEN); serverInfo.serverPort = _ttoi(portCString); int ret = hwmsdkagent::SetServerAddress(&serverInfo); if (hwmsdk::HWM_COMMON_SUCCESS != ret) { AfxMessageBox(_T("set server address error")); return; } CDialogEx::OnOK(); } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot