wininet

Bandwidth from Latency

橙三吉。 提交于 2020-01-03 04:55:10
问题 DUPE: How to programmatically check Internet bandwidth in VC++? Can we find the bandwidth from the latency of ping .If yes how is it done 回答1: There is however a technique called packet pair probing. You send to packets one immediately after the other. In theory, the less bandwidth available, the more they will spread away in arrival time. 回答2: No, generally speaking there not much of relation. See Wiki: Comparison of latency and throughput. Never underestimate the bandwidth of a station

InternetOpenUrl only returns after entire HTTP response is downloaded

冷暖自知 提交于 2020-01-01 10:56:08
问题 I am writing a download file utility using WinINET, and have noticed (especially on large downloads), that the WinINET InternetOpenUrl() call only returns after the entire HTTP response has been downloaded. I confirmed this by using the Charles proxy tool, as well as using WireShark, and noticed that the download completes entirely and only then does WinINET notify my code. Some simplified (synchronous) code: hInt = InternetOpen(USER_AGENT_NAME, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);

Delphi soap https authentication failure pops up a dialog box

╄→尐↘猪︶ㄣ 提交于 2020-01-01 09:33:24
问题 We have a delphi XE application that uses SOAP (THTTPRIO etc) communications which (in delphi) works over WinInet.dll, by default. We fixed the authentication code so that it works, using https authentication, and when the user name and password for https are correct, everything is fine. The problem is that when authentication details are incorrect, you get a message box from Windows, that is probably being popped up by WinInet.dll itself. I want to make that dialog box go away. I can't

HttpSendRequest fails with error 12015

你说的曾经没有我的故事 提交于 2019-12-24 20:24:39
问题 I have created a Win32 Service which uses WinInet to send HTTP-requests to remote host. On my computer (WinXP SP2), on test workstations in our QoS-team (Win2003 Server) it works fine - over proxy and direct, proxy with auth and without). But some of our customers, that uses this service and_proxy_with_authorization on Win2003 Server, have a problem - all calls of HttpSendRequest fails and GetLastError returns 12015 (ERROR_INTERNET_LOGIN_FAILURE, The request to connect and log on to an FTP

uploading files using httpSendRequest c++

独自空忆成欢 提交于 2019-12-24 17:02:41
问题 I am trying to send a file to HTTP server via POST request (c++ and winapi), steps: // Read file into "buff" and file size into "buffSize" .... .... .... HINTERNET internetRoot; HINTERNET httpSession; HINTERNET httpRequest; internetRoot = InternetOpen(agent_info, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL); //Connecting to the http server httpSession = InternetConnect(internetRoot, IP,PORT_NUMBER, NULL, NULL, INTERNET_SERVICE_HTTP, NULL, NULL); //Creating a new HTTP POST request to the

Invoke WinInet Functions Used Java + JNA

大憨熊 提交于 2019-12-24 15:48:45
问题 sorry for my English. I try invoke WinInet InternetSetOptionW method for setting up IE proxy. InternetSetOptionW returns me "true", but IE proxy doesn't change. What i do wrong? import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.ptr.LongByReference; import com.sun.jna.win32.StdCallLibrary; public interface WinInet extends StdCallLibrary { public WinInet INSTANCE = (WinInet) Native.loadLibrary("Wininet", WinInet.class); public boolean InternetSetOptionW(int unused, int

Set timeout for InternetReadFile (WinInet + Delphi)

淺唱寂寞╮ 提交于 2019-12-24 06:44:48
问题 My application needs to process a list of urls, by retrieving their text content. My internet connection is started by myTimeOut:= 2000; InternetSetOption(nil, INTERNET_OPTION_CONNECT_TIMEOUT, Pointer(@myTimeOut), SizeOf(myTimeOut)); InternetSetOption(nil, INTERNET_OPTION_SEND_TIMEOUT, Pointer(@myTimeOut), SizeOf(myTimeOut)); InternetSetOption(nil, INTERNET_OPTION_RECEIVE_TIMEOUT, Pointer(@myTimeOut), SizeOf(myTimeOut)); I'm launching separate threads for each url reading (...) read_url

InternetCheckConnection always return false

雨燕双飞 提交于 2019-12-23 20:10:35
问题 I want to use the Wininet function InternetCheckConnection to check whenever the machine is connected to the internet and can access a specific host. The problem is that this function is always returning false , no matter the URL I put on it. MSDN link 回答1: Following combination works for me on Windows 7 and Windows XP SP3: InternetCheckConnection("http://www.google.com", FLAG_ICC_FORCE_CONNECTION, 0) ; GetLastError() returns 0 if the connexion is possible and it returns 12029 (The attempt to

How to avoid full CPU utilisation, or terminate, while InternetOpenURL is trying (and failing) to connect?

匆匆过客 提交于 2019-12-23 02:48:05
问题 I have a fairly simple application which downloads files in a thread. This thread uses the WinINet APIs, and begins like so: HINTERNET hInternet = InternetOpen(strUserAgent.c_str(), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); DWORD dwFlags = INTERNET_FLAG_NO_UI | INTERNET_FLAG_HYPERLINK | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD; HINTERNET hUrl = InternetOpenUrl(hInternet, m_strURL.c_str(), L"", 0, dwFlags, NULL); However, if there is no internet connection, or the remote host is

What is the maximum URL length you can pass to the Wininet function, HttpOpenRequest?

人走茶凉 提交于 2019-12-20 03:11:08
问题 What is the maximum URL length you can pass to the Wininet function, HttpOpenRequest? 回答1: HttpOpenRequest does not have a maximum length but server software you are targeting will likely have a limit on your URL length. Apache (Server) My early attempts to measure the maximum URL length in web browsers bumped into a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error. I used the current up to date Apache build found in Red Hat