📄 bandwidthinstanceobject.cpp
字号:
wsRtn = infoString; CStringHelper::Str2Param(wsRtn, bRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionAdaptive")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionAdaptive")); return bRtn;} // GetSessionAdaptive()//==============================================================================// SetSessionAdaptive()//==============================================================================bool Intel::Mobile::Context::BandwidthInstance::SetSessionAdaptive( SOCKET socketid, bool IsAdaptive ){ bool bRtn = false; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; wsParams.append(IntelMobileText(",")); wsParams.append(CStringHelper::Param2Str(IsAdaptive)); IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("SetSessionAdaptive"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, bRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("SetSessionAdaptive")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("SetSessionAdaptive")); return bRtn;} // SetSessionAdaptive()//==============================================================================// GetSessionLimitedTx()//==============================================================================bool Intel::Mobile::Context::BandwidthInstance::GetSessionLimitedTx( SOCKET socketid ){ bool bRtn = false; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("GetSessionLimitedTx"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, bRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionLimitedTx")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionLimitedTx")); return bRtn;} // GetSessionLimitedTx()//==============================================================================// GetSessionLimitedRx()//==============================================================================bool Intel::Mobile::Context::BandwidthInstance::GetSessionLimitedRx( SOCKET socketid ){ bool bRtn = false; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("GetSessionLimitedRx"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, bRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionLimitedRx")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionLimitedRx")); return bRtn;} // GetSessionLimitedRx()//==============================================================================// SetSessionLimitedTx()//==============================================================================bool Intel::Mobile::Context::BandwidthInstance::SetSessionLimitedTx( SOCKET socketid, bool IsLimited ){ bool bRtn = false; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; wsParams.append(IntelMobileText(",")); wsParams.append(CStringHelper::Param2Str(IsLimited)); IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("SetSessionLimitedTx"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, bRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("SetSessionLimitedTx")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("SetSessionLimitedTx")); return bRtn;} // SetSessionLimitedTx()//==============================================================================// SetSessionLimitedRx()//==============================================================================bool Intel::Mobile::Context::BandwidthInstance::SetSessionLimitedRx( SOCKET socketid, bool IsLimited ){ bool bRtn = false; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; wsParams.append(IntelMobileText(",")); wsParams.append(CStringHelper::Param2Str(IsLimited)); IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("SetSessionLimitedRx"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, bRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("SetSessionLimitedRx")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("SetSessionLimitedRx")); return bRtn;} // SetSessionLimitedRx()//==============================================================================// GetSessionPercentTx()//==============================================================================float Intel::Mobile::Context::BandwidthInstance::GetSessionPercentTx( SOCKET socketid ){ float fRtn = 0.0; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("GetSessionPercentTx"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, fRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionPercentTx")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionPercentTx")); return fRtn;} // GetSessionPercentTx()//==============================================================================// GetSessionPercentRx()//==============================================================================float Intel::Mobile::Context::BandwidthInstance::GetSessionPercentRx( SOCKET socketid ){ float fRtn = 0.0; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { //vector<IntelMobileString> vectParam; UINT64 ui64SockKey = CreateSocketKey(socketid); //vectParam.push_back(CStringHelper::Param2Str(ui64SockKey)); IntelMobileString wsParams = CStringHelper::Param2Str(ui64SockKey), wsRtn; IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("GetSessionPercentRx"), (IntelMobileChar*)wsParams.c_str()); wsRtn = infoString; CStringHelper::Str2Param(wsRtn, fRtn); delete []infoString; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionPercentRx")); } else THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("GetSessionPercentRx")); return fRtn;} // GetSessionLimitRx()//==============================================================================// CreateSocketKey()//==============================================================================unsigned __int64 Intel::Mobile::Context::BandwidthInstance::CreateSocketKey( SOCKET aSocket ){ unsigned __int64 key = 0; SOCKADDR_IN sockname; int nSize = sizeof(SOCKADDR_IN); if ( !::getsockname( aSocket, reinterpret_cast<sockaddr*>(&sockname), &nSize ) ) { // key = sockname.sin_addr.S_un.S_addr ; // Local Address printf(": bug in ntel::Mobile::Context::BandwidthInstance::CreateSocketKey( SOCKET aSocket )\n"); key = key<< 32; key += ::ntohs( sockname.sin_port ); // Local Port } else { THROWNE(IntelMobileText("Intel::Mobile::Context::BandwidthInstance"), IntelMobileText("CreateSocketKey")); } return key;} // CreateSocketKey//==============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -