indy

(Indy) TIdHTTP EIdSocketError Socket Error # 0 exceptions when downloading files

雨燕双飞 提交于 2019-12-11 06:09:24
问题 I have this delphi code that basically download files from a secure server (using Indy build 10.5.8 r4743 if I'm not mistaken): The problem is: I'm getting random "Socket Error # 0" exceptions that I couldn't get fix or even understand: Project MyProject.exe raised exception class EIdSocketError with message 'Socket Error # 0 Stack is here, pascal code is: IdHTTP := TIdHTTP.Create(nil); TheSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); TheCompressor := TIdCompressorZLib.Create(nil);

Should I be afraid to use UDP to make a client/server broadcast talk?

做~自己de王妃 提交于 2019-12-11 03:44:36
问题 I spent the last two days reading each StackOverflow questions and answers (and googling of course) about Indy TCP and UDP protocol in order to decide which one should I use in my communication method between my User Application and my Windows Service. From what I saw so far, UDP is the easiest and the only one I managed to work to receive broadcast messages from TidUDPClient (I did not testes the response back yet). And I also noticed that TCP is a bit more complicated with it's thread loop.

Better Indy for Dephi 2007

。_饼干妹妹 提交于 2019-12-11 03:39:53
问题 Which better is using default indy10 that's comes with Delphi 2007 or upgrade it to latest snapshot version and why ? Thank you 回答1: Always keep up with the latest version. It contains bug fixes. If you report a problem with the stock version supplied with Delphi, the first advice you'll get is to upgrade to the latest version because your bug has probably already been fixed. 回答2: Do not always keep up with the latest version. Download latest version now and start your project with it. Then

Amazon MWS API Call Using Delphi/Indy

北城以北 提交于 2019-12-11 03:31:30
问题 I'm developing a simple application to "talk" to the Amazon MWS API. Because a lot of existing code is at play here, I need to get this done in Delphi 2010 with Indy 10 (10.5.5) components, which I have used successfully to integrate with many other APIs in the past. However, the Amazon API seems to be incredibly sensitive to the smallest of details, to the point that all my calls are being denied with the already infamous "SignatureDoesNotMatch" error message. Here's what I have accomplished

TIdHttpServer freezing when Active set to False after Windows Update

牧云@^-^@ 提交于 2019-12-11 03:13:05
问题 We have a Indy (version 10.6.1.5235) TIdHttpServer "service" that has worked well for years with Delphi 2007. After the most recent Windows Update (KB4338815 and KB4338830) we noticed the service freezes when TIdHttpServer is set to false. I have included source code where TIdHttpServer is created. In our service "Stop" handler we set IdHttpServer1.Active to False and this is where it freezes. It seems Indy hangs when it is trying to close the http connections. Is there a work around? Update

How to decode gzip encoded html?

风流意气都作罢 提交于 2019-12-11 02:43:54
问题 I got data from web server: data := ' HTTP/1.1 200 OK Content-Encoding: gzip Vary: Accept-Encoding Content-type: text/html Transfer-Encoding: chunked Server: Apache 3d5 ???????????????????????????????????? ???????????????????????????????????? ???????????????????????????????????? '; The size of data is: 3d5 (in hex) all is stored to TIdBytes variable "data". How to decode gziped data, change something in it, and encode back and edit the length 3d5 to new. 回答1: The Transfer-Encoding response

Sending email with Indy 9 with an embedded picture

蹲街弑〆低调 提交于 2019-12-11 02:35:57
问题 I am trying to add to a program of mine the capability of sending html email via SMTP with Indy 9. If the program only contains text (the text will be in Hebrew so I need to display it right to left, which means that I am using HTML statements), then the email is sent correctly. My problem lays with embedding pictures into the HTML stream. The HTML stream will use a command like <IMG SRC="cid:foo4atfoo1atbar.net" ALT="IETF logo"> Whilst the Indy 10 component TIdAttachmentFile has a

How to send a DELETE request with Indy?

。_饼干妹妹 提交于 2019-12-10 23:45:23
问题 I tried several search for examples on the web on how to send a DELETE request with TidHTTP without success... I'm working with Delphi Indy 10.0.52. Apparently there is not such a method as Delete in the TIdHTTP object. Is it possible? I'm missing something here... Help! I ended up with something (not working) like this: procedure TRestObject.doDelete( deleteURL:String ); var res : TStringStream; begin res := TStringStream.Create(''); http := TidHTTP creation and init... try http.Request

TIdTCPServer not reading data from socket sometimes

时间秒杀一切 提交于 2019-12-10 23:08:21
问题 I have the following code in the OnExecute of a TIdTCPServer (Delphi 2009 and Indy 10 that came with the installation) which is very similar to other examples on this site; Socket := AContext.Connection.Socket; if Socket.CheckForDataOnSource(10) then begin if not Socket.InputBufferIsEmpty then begin Socket.InputBuffer.ExtractToBytes(RawBytes, -1, False, -1); SetLength(Buffer, Length(RawBytes)); Move(RawBytes[0], Buffer[1], Length(RawBytes)); // Do stuff with data here... end; end; AContext

How to direct DataSnap client connections to various DS Servers?

半腔热情 提交于 2019-12-10 19:49:37
问题 I have a quite big DataSnap server that will be running 24/7, it will substitute a currently running MIDAS (COM) server. Now I'm facing the problem of how to update that server without having to force disconnection of all connected clients. With the current midas server (that, by the way, doesn't have a huge traffic to serve) I simply wait until there are no connections, then shut down the server application and substitute the exe file. If a new connection occurred while the server was "down"