indy

Measuring network traffic with Indy

六眼飞鱼酱① 提交于 2019-12-04 07:35:22
I'm using a TIdTCPCmdServer to handle all communication with client applications. I would like my server to log all kind of stuff including network traffic. Is there any easy or clever way to see how much bytes the TCPCmdServer actually received and sent? I can only think of code like ASender.SendReply; Inc (FTraffic, Sizeof (ASender.NormalReply.Code) + Sizeof (Char) * ASender.NormalReply.Text.Length)); which is extremely ugly in my opinion because these traffic updates would be spreaded out all over my code and are fairly complicated as well. Any suggestions? Thanks for your help. Look into

Getting HTML from response stream using Indy's IDTCPClient [closed]

拟墨画扇 提交于 2019-12-04 07:15:35
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . I have a component that a previous employee has created. It uses Indy (IDTCPClient) and the following method to perform requests (Where "aReadHeader" is a predefined Uri built before being passed in). function TMyConnector.GET(aRawHeader: String): String; begin if Not Connected then Connected :=

How to send several emails in a single connection of IdSMTP?

十年热恋 提交于 2019-12-04 07:13:24
问题 I am using Indy 10 on C++Builder 6.0 Professional Edition. My SMTP server imposes a limit on the number of connections in a certain time interval, so I need to send more than one email using the same connection. Is it possible? How can I do that ? I am already able to connect and send one email on each connection. Thank you very much for any help. 回答1: You can call TIdSMTP.Send() multiple times between a single pair of Connect() / Disconnect() calls, adjusting the TIdMessage as needed for

When does background threads prevent the process of being terminated?

被刻印的时光 ゝ 提交于 2019-12-04 06:57:01
Our program creates a background thread at the beginning of the program. The background thread does some database integrity checks and checks for stuff in the Internet using Indy. After 10 seconds, the background thread should be finished and since FreeOnTerminate is true, it will also clean itself up. We have noticed that in some cases, if the user closes the program too quickly, the process will still be alive until the background thread is finished. Since we couldn't exactly reproduce the issue, I have created a demo project to try a few things: type TBackgroundThread = class(TThread)

Indy 10 - IdSMTP.Send() hangs when sending messages from GMail account

拟墨画扇 提交于 2019-12-04 06:42:12
I am trying to send an e-mail using gmail account (Delphi 7, Indy 10) with these settings: TIdSmtp: Port = 587; UseTLS := utUseExplicitTLS; TIdSSLIOHandlerSocketOpenSSL: SSLOptions.Method := sslvTLSv1; Everything seems to be set ok. I get this response: Resolving hostname smtp.gmail.com. Connecting to 74.125.77.109. SSL status: "before/connect initialization" SSL status: "before/connect initialization" SSL status: "SSLv3 write client hello A" SSL status: "SSLv3 read server hello A" SSL status: "SSLv3 read server certificate A" SSL status: "SSLv3 read server done A" SSL status: "SSLv3 write

Which is current correct indy and open ssl versions to use with delphi2007

若如初见. 提交于 2019-12-04 06:23:38
问题 I'm using indy components with D2007 and try to list subject of messages from a imap mailbox. I downloaded and installed current indy new version 10.6.0.5039 (installing x100 packages) and tried with various openssl dll versions (32bit on xp machine, copied both in system32 dir and in my app dir) but always got "could not load ssl library" error. Could someone tell me the right indy dcl package and openssl dll to use with D2007? Using function WhichFailedToLoad i get the result: "SSL_CTX_set

Indy “Could not load SSL Library” with Delphi 2007/Apache

你。 提交于 2019-12-04 04:07:46
问题 I know this question has been asked a number of times. I seem to have a bit of a different problem. In my situation after the exception is thrown initially it works fine (and no; I did not turn off exceptions). So what I have done is on the exception I simply repost: IdHTTP1.Post(....... I have put the libeay32.dll and ssleay32.dll both in the Apache bin directory and the directory where my ISAPI dll resides. Anyone have any suggestions? 回答1: For Indy you need a special build of OpenSSL

How to send a mail message using Indy's smtp server component?

我怕爱的太早我们不能终老 提交于 2019-12-04 03:48:08
Since the demo given in http://www.indyproject.org/Sockets/Demos/index.EN.aspx only saves the received stream to a file, I don't know how to effectevely send that stream as a mail. Could anyone teach me how to do this or to point me some more complete example? A SMTP server component can't send mail - it can only receive it. You need a SMTP client component (TidSMTP) to send mail. A mail server when it sends mail acts like an SMTP client. Here's a complete example on how to send an email: VAR SMTP : TIdSMTP; VAR MSG : TIdMSG; . . MSG:=TIdMSG.Create(NIL); TRY WITH MSG.Recipients.Add DO BEGIN

Delphi + Indy: Connection closed gracefully

你离开我真会死。 提交于 2019-12-04 03:15:13
问题 Using D7 + Indy 10 latest build. My code is using TIdSMTP to send email. I keep getting "Connection closed gracefully" at some end-users, and the email is never sent. The code is like: try ~~~~ ~~~~ _idSMTP := TIdSmtp.Create; with _idSMTP do begin Host := 'myhost'; Connect; try Send(_EmailMsg); Result := True; except on E: Exception do begin MsgDlgErr(Self.Handle, E.Message) end end; end; finally _idSMTP.Disconnect; _idSMTP.Free; end; Any advice? 回答1: Read all about it on http://www

Indy Write Buffering / Efficient TCP communication

喜欢而已 提交于 2019-12-04 03:14:46
I know, I'm asking a lot of questions...but as a new delphi developer I keep falling over all these questions :) This one deals with TCP communication using indy 10. To make communication efficient, I code a client operation request as a single byte (in most scenarios followed by other data bytes of course, but in this case only one single byte). Problem is that var Bytes : TBytes; ... SetLength (Bytes, 1); Bytes [0] := OpCode; FConnection.IOHandler.Write (Bytes, 1); ErrorCode := Connection.IOHandler.ReadByte; does not send that byte immediately (at least the servers execute handler is not