Skip to main content
gamedev.net
🔒 Locked

ERROR_WINHTTP_CANNOT_CONNECT (12029)???

Started by fathom88 0 replies 3.6k views
Original Post
fathom88
fathom88
I'm getting a ERROR_WINHTTP_CANNOT_CONNECT when I call InternetConnect. There isn't much info on it other than the obvious (it can't connect). The app works fine for a while (hours) and then it starts returning this error. When I restart the app, the app works fine again. This leads me to think it's the app itself and not the server. The app connects to FTP server and sends a file. main() { hinternet = NULL; hinternet = InternetOpen("MyApp",INTERNET_OPEN_TYPE_DIRECT,NULL,0,0); } ..another thread { while(run == true) { if(UpdateFile() == true) { hftp = InternetConnect(hinternet, "some_server", 123, INTERNET_DEFAULT_SOCKS_PORT, "user", "user"...); if(hftp == NULL) { InternetCloseHandle(hinternet); hinternet = InternetOpen("MyApp",INTERNET_OPEN_TYPE_DIRECT,NULL,0,0); } else { FtpWriteFile(..); InternetCloseHandle(hftp); } } } } Am I missing something?? I close the handle to InternetConnect after a successful ftp of file. On errors, I close the handle to InternetOpen and open a new handle. Thanks in advance.
Maega
Maega
Repost the correct code using source tags. Your InternetConnect line is totally wrong as is :).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.