Delphi Idhttp Socket Error 10061
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the
Asynchronous Socket Error 10061 Delphi
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions socket error 10061 connection refused delphi Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up TIdHTTP exception handling up vote 0 down vote favorite I created a program that automatically connects to our local server and downloads updates, here is the code: // Connect to web server and download ToBeInstalled.ini Url := 'http://'+IPAdd+'/ToBeInstalled.ini'; MS := TMemoryStream.Create try try http.Get(url, MS); code := http.ResponseText; except on E: EIdHTTPProtocolException do code := http.ResponseCode; end; MS.SaveToFile(UserPath + 'ToBeInstalled.ini'); finally http.Free(); end; The program works quite well while in the office but when users are home and cannot reach the server or the server is not available the get "socket error # 10061' I have no idea how to catch that one and the worse is that the program stop execution all together after that error message is displayed. Do you have any idea how to fix that. Thank you so much. delphi delphi-xe2 indy10 share|improve this question asked Apr 28 '13 at 22:55 Cor4Ever 951413 add a comment| 1 Answer 1 active oldest votes up vote 6 down vote accepted Your exception handler is only catching EIdHTTPProtocolException exceptions specifically, but there are several other types of exceptions that can be raised as well, including EIdSocketError. You need to update your handler accordingly, or just have it catch all possible exceptions instead of looking for specific types. Since you say an uncaught exception caused your entire app to fail (which means you have bigger problems to deal with than just TIdHTTP), you should also update the code to handle exceptions raised by TMemoryStream as well. Try this: // Connect to web server and download ToBeInstalled.ini Url := 'http://'+IPAdd+'/ToBeInstalled.ini'; try MS := TMemoryStream.Create try http.Get(url, MS); code := http.ResponseText; MS.SaveToFile(UserPath + 'ToBeInstalled.ini'); finally MS.Free; end; except on E: EIdHTTPProtocolException do begin code := http.ResponseCode; end; on E: Exception begin // do something else end; end; share|improve this answer answered Apr 28 '13 at 23:02 Remy Lebeau 231k13140268 That di
exception: --------------------------- De{*word*81} Exception Notification --------------------------- Project ChangeWP.exe raised exception class EIdSocketError with message 'Socket Error # 10061 Connection refused.'. Process stopped. Use Step or Run to continue. --------------------------- OK Help --------------------------- My internet explorer have no any proxy,and my dns setting problem,Why is it?Fllowing are that code: function GetWebPageHTML(URL: string): string; var IDHTTP: TIDHttp; begin Result:= ''; IDHTTP:= TIDHTTP.Create(nil); try try idhttp.HandleRedirects:= true; idhttp.ReadTimeout:= SysParam.HTTP_TIMEOUT; Result:= IDHTTP.Get(URL); { Here raise a exception --------------------------- De{*word*81} Exception Notification --------------------------- Project ChangeWP.exe raised exception class EIdSocketError with http://stackoverflow.com/questions/16268913/tidhttp-exception-handling message 'Socket Error # 10061 Connection refused.'. Process stopped. Use Step or Run to continue. --------------------------- OK Help --------------------------- } except end; finally IDHTTP.Free; end; end; Delphi,CB --- posted by geoForum on delphi.newswhat.com Remy Lebeau (TeamB) Delphi Developer 2004-12-18 03:56:13 AM Re:EIdSocketError with message 'Socket Error # 10061? "tzdgg" Thank you Remy. FWIW, Indy download page is confusing, just a reminder to myself / anyone in the same position, the real download link to https://recalll.co/app/?q=delphi%20-%20(Indy)%20TIdHTTP%20EIdSocketError%20Socket%20Error%20 the latest build is here...I'll try with the latest build & see https://www.sysaid.com/Sysforums/posts/list/388.page if I still have this issue, thanks! Project blabla.exe raised exception class EIdOSSLUnderlyingCryptoError with message 'Error connecting with SSL. error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure'. IMHO, the download page is not confusing, it is accurate and straight forward, it just takes a few links to find the actual download link, that's all. socket error There is a lot of information to convey to users before they download. You are getting an SSL handshake error, so no, your SSL setup is not valid. Double-check your settings. Remy: IdHTTP.Post(https_url) works just fine so I assume SSL is fine...I'm no expert here, what do you mean by SSL setup is not valid? delphi - (Indy) TIdHTTP EIdSocketError Socket Error # 0 socket error 10061 exceptions whe... View More at http://stackoverflow.com/questions/13233648/indy-tidhttp-eidsocke... Please upgrade to the latest Indy 10 version, which is 10.5.8 r4743. SSL-related issues with Error Code 0 were fixed over a year ago. Thank you so much Remy! I deleted the old Indy version (including the old dcu, bpl, etc... files) re-build everything and now I'm not able to see the error when running the tests on EC2/Windows (ie. upload files from EC2 to S3). However, I still see the same errors when uploading from my machine... The fact that the ResponseCode is -1 means that either the response is malformed or the error is occurring before TIdHTTP even receives the first line of the response. Can you see the response correctly in a packet sniffer like Wireshark or Fiddler? What does the call stack look like in the debugger when the error is raised? [TCP Retransmission] Ignored Unknown Record Secure Sockets Layer Ignored Unknown Record GlobalCookieManager.CookieCollection.AddCookie() TUploadThread.NewCookie() only the first two cookies are valid AddCookie() takes ownership of the cookie that is passed to it. So you end up with multiple TIdCookieManager objects referring to the same physical cookie objects. Tha Connection Refused. Socket Error #10061 Connection Refused. Post Reply Author Message qhdevon43 SysAider 4 Socket Error #10061 Connection Refused. Jul. 05, 2008 12:55 AM Hello I am using the On-demand version of Sysaid and when I downloaded and tried installing the deployment tool I got an error that said Socket Error #10061 Connection Refused. All the information was correct ... I also tried download the sysaidagent.exe and it was asking for the same credentials in which I put in the right information but it said Socket Error #10061 Connection Refused. What am I doing wrong.. I have used the Full version I am just trying the Online version of sysaid but I am having more problems.... René Rijk Elite SysAider 234 Re:Socket Error #10061 Connection Refused. Jul. 05, 2008 04:31 AM This is a connection refused error. The target machine refuses the connection. The most common cause is a incorrect port specified by the client. It also can be caused by a firewall or anti-virus software. Be sure those 2 don't blocking any ports needed by sysaid. Kind regards, René Take a look at my 3D creations and here is a little animation I made Haim SysAid Wiz 2449 Socket Error #10061 Connection Refused. Jul. 06, 2008 12:42 AM Hello qhdevon43. Please use the same details (URL, accoutID and serial key) that are located in preferences > downloads in the deployment tool installation. Also, please make sure to include the full URL which includes the port number during the installation. Best regards. Haim This message was edited 1 time. Last update was at Jul. 06, 2008 12:42 AM Pushing IT forward qhdevon43 SysAider 4 Re:Socket Error #10061 Connection Refused. Jul. 09, 2008 11:55 AM Yes I am positive that I No antivirus software or firewall is blocking this program... Also Yes I am using the same credentials from the download tab.... However, Do certain ports have to be open on my network to get the On Demand version working? I could not use the full version of Sysaid deployment tools because certain TCP and UDP ports are blocked on my network at my university. Could that be the same isssue with this on demand version of sysaid deployment tools? Thanks... Haim SysAid Wiz 2449 Socket Error #10061 Connection Refused. Jul. 10, 2008 07:05 AM The deployment tool for the on-demand edition and the in-house edition is the same tool. The only difference is that in the on demand edition, we provide SysAid as a "SaaS" (software as a service) and it is installed on our servers. The deplo