作为我的Windows手机应用程序的一部分,我使用Windows::Web::Http::HttpClient将请求发布到服务器。我试过了 -
void sendRequest(HttpRequestMessage^ httpReqMsg)
{
HttpBaseProtocolFilter^ httpFilter = ref new HttpBaseProtocolFilter();
httpFilter->CacheControl->WriteBehavior = HttpCacheWriteBehavior::NoCache;
HttpClient^ httpClient = ref new HttpClient(httpFilter);
try
{
// Post the request
auto httpProgress = httpClient->SendRequestAsync(httpReqMsg);
// Handle the http progress and it's response messages
// ...
}
catch(Exception^ ex)
{
// ...
}
} // httpFilter, httpClient are auto released
当httpFilter, httpClient
超出范围时,我希望应该释放底层套接字和内存资源。在通话HttpClient::SendRequestAsync
期间,我看到第一次发生SSL协商。对sendRequest
函数的任何进一步调用都不会触发完全握手。
我不允许加载任何DLL以明确清除SSL缓存(SslEmptyCache)。我的假设是否正确,每次调用sendRequest
函数时都应该进行完全握手?如果没有,如何实现完整的SSL握手?感谢。