indy10

Indy 10 + Delphi Client-Server App Eats up all CPU

你。 提交于 2019-12-06 17:49:29
I wrote a small client-server application that runs on two or more distinct machines for reboot / shutdown purposes. Since I'm relatively new to client-server apps, I took the About Delphi approach here . Shortly put, my server app awaits connections on port 7676, adds the client to a client list then does nothing (will implement the shutdown and restart procedures later). However, even if it's passive, it eats up to 90% of CPU with only two clients connected. Here's the client code, made up of an TidTCPServer and a TidAntiFreeze: type PClient = ^TClient; TClient = record PeerIP : string[15];

Reading response from TIdDNSResolver?

邮差的信 提交于 2019-12-06 14:33:18
I cannot find any simple examples of a DNS lookup using Indy 10's TIdDNSResolver component. They're all either for something I don't need (such as MX/SMTP), or are talking terms with no code . I have tried reading the result based on the few resources I can find, but don't know how I'm supposed to be reading the result. Here's what I have so far... uses IdBaseComponent, IdComponent, IdTCPConnection, IdDNSResolver; function TForm1.Lookup(const Name: String): String; var X: Integer; begin //DNS: TIdDNSResolver DNS.QueryType:= [qtA]; DNS.Resolve(Name); for X:= 0 to DNS.QueryResult.Count-1 do

how to convert idhttp downloaded image from extention to another?

会有一股神秘感。 提交于 2019-12-06 12:57:15
问题 i have this Thread that get image url from the web then save it to memory stream then save from memory stream To file i needed to convert any image that downloaded to a gif image so i do something like this unit downloadimgThread; interface uses Windows, SysUtils, Classes, dialogs, IdSSLOpenSSL, IdHttp, IdUri, System.AnsiStrings, Graphics, Jpeg, Vcl.Imaging.GIFImg, PNGImage; type TDownloadUpdateVisualEvent = procedure(Sender: TObject; Anameofimg: String; var Aimagelocate: String) of object;

Delphi XE3 indy compatibility issue between tbytes and tidbytes

北战南征 提交于 2019-12-06 10:49:50
I already saw post at Delphi XE4 Indy compatibility issue between TBytes and TidBytes about compatibility issues between the data types tbytes and tidbytes. From the second answer I learned, that it looks like they can't be used together even though they're both array of byte. However, the latest answer says, that in indy 10.5.9 it was dependent of the presence of TBytes, and that only in Indy 10.6 was it completely submitted as array of byte. Anyway,I have a .pas unit which decodes several packets from IdUDPServerUDPRead event, but can't get them together. I always get the error: [dcc32 Error

What's the difference between TIdNotify and TIdSync?

 ̄綄美尐妖づ 提交于 2019-12-06 09:05:24
问题 I'm in trouble understanding the real difference between IDSYNC and IDNOTIFY, what means synchronous / asynchronous in respect to the lines of code I write ? procedure TForm1.IdTCPServerExecute(AContext: TIdContext); begin .... DoSomeThing (TIDNotify) .... DoSomethingOther(TIDsync) ...... end; Why can't I be sure that both lines of code are executed within the TCPServer Execute function? Is there only the risk that a few lines of code are not executed within my TIDSynfunction or how can a

How can I download a huge file via TIdHTTP?

ぃ、小莉子 提交于 2019-12-06 08:58:00
问题 I use this code to download small files: Var ms:TMemoryStream; begin ms:=TMemoryStream.Create; Idhttp1.get('http://mydomain.com/myfile.zip',ms); ms.SaveToFile('myfile.zip'); ms.Free; end; But file is saved in RAM before storing to disk, so it may be difficult to download files >1Gb, for example. Is there a way to download a file by its parts? Or do I need to use the WinInet? Thanks in advance! 回答1: TMemoryStream provides an in-memory buffer, so if you download into one, you need to have

sending mail but no message-id

∥☆過路亽.° 提交于 2019-12-06 04:05:34
I am getting interesting rejections from my clients mail server when sending a mail with indy-10's tidMessage component saying: 550 Rejected: Message does not contain a Message-ID I get this even when using indy's own demo app http://www.indyproject.org/DemoDownloads/Indy_10_MailClient.zip what do I do to fix this. thanks! TIdMessage in Indy 10 intentionally omits the 'Message-Id' header when encoding an email to a socket or TStream. You will have to use the TIdMessage.ExtraHeaders property, eg: IdMessage1.MsgId := ...'; IdMessage.ExtraHeaders.Values['Message-Id'] := IdMessage1.MsgId; EDIT: As

Indy server supports SSL 2, but it should not

落花浮王杯 提交于 2019-12-05 20:25:44
Indy Delphi 10.1 Berlin. My customer had the HTTPS connection checked (using Qualys SSL Labs). The report states: "This server supports SSL 2" plus other warnings but I guess they are related to this. The code used is as follows: SSLIOhandler:=TIdServerIOHandlerSSLOpenSSL.Create(NIL); SSLIOhandler.SSLOptions.Method:=sslvTLSv1_2; SSLIOhandler.SSLOptions.Mode:=sslmServer; SSLIOhandler.OnVerifyPeer:=OnVerifyPeer; SSLIOhandler.SSLOptions.SSLVersions:=[sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; HTTPServer:=TIdHTTPServer.Create(NIL); HTTPServer.IOhandler:=SSLIOhandler; I have read various posts but this

UDP Packet not captured by Wireshark, but is captured by UDP application

微笑、不失礼 提交于 2019-12-05 17:54:43
I have an application that is designed and working that is receiving UDP broadcasts on a port. The application has been working just fine, but I have wanted to compare the packets received by the application with a Wireshark capture. I'm trying to make sure that I'm capturing as many of the packets as possible with minimal data loss. I initially thought that I'd run Wireshark and compare the raw packets captured against the packets shown in our application. However, when I run Wireshark, the packets are never captured at the IP layer for that port. I see other traffic from the server, but I

Indy TIdHTTP URI with login/password not working

帅比萌擦擦* 提交于 2019-12-05 06:17:52
问题 I'm writing an HTTP API wrapper to integrate with particular IP Cameras. Part of the process requires login credentials in the URI, for example: http://user:pass_with_#_sign@address:port/somespecificpath/ I'm using Indy's TIdHTTP.Get to send the request to the device. However, the password consists of a '#' character. If this URI is placed in any browser with the plain password, the # character throws it off. Therefore, I need to encode the password's # to %23 ... http://user:pass_with_%23