indy

Delphi XE2 / Indy TIdTCPServer / “Connection reset by peer”

半腔热情 提交于 2019-12-24 00:28:00
问题 I'm with one problem using Indy in Delphi XE2 to send TCP Messages using TIdTCPServer. For exemple: I have 2 devices and i'll go communicate with device 1. When i send messages to device 1, the messages were send fine. But without close the program, when i send messages to device 2, Delphi returns "Connection reset by peer". Below is my code: procedure TMainHost.idTCPServerNewConnect(AContext: TIdContext); var Client: TSimpleClient; begin Sleep(1000); Client := TSimpleClient.Create(); Client

Save Cookies inside TIDCookieManager to file

我与影子孤独终老i 提交于 2019-12-23 11:57:35
问题 How can I save cookies inside TIdCookieManager to a file so that they can be used later? Like browser cookies. 回答1: TIdCookieManager does not have any native support for persisting cookie data in files. You have to implement that manually. Use the TIdCookieManager.CookieCollection property to access the list of cookie objects. For example: uses ..., IdCookie, IdCookieManager; var Cookies: TIdCookieList; Cookie: TIdCookie; I: Integer; begin Cookies := IdCookieManager.CookieCollection

Does Indy ping require UAC elevation?

不羁岁月 提交于 2019-12-23 10:39:57
问题 Does the Indy ICMP component require Administrator privileges to ping? If I run with UAC turned on but without elevated privileges I get an "Access Denied" error message. Looking at this question it sounds like Indy ICMP uses RAW sockets and thus needs elevated privileges? I'm developing using Delphi 2007 & Indy 10.x and testing under Windows 7 Pro. 回答1: My colleague found this Article states that the Indy ICMP component uses RAW Windows sockets, which under Vista or later requires elevated

TIdHTTP - session has expired message under Delphi XE

自作多情 提交于 2019-12-23 07:16:28
问题 I am trying to port my code from Delphi 2007 to Delphi XE (no Update 1 yet). The problem which I have stumbled on is that under Delphi XE I am getting different response from server after sending second GET message. The message in formated HTML says that my session has expired. However, the same code works without any problems under Delphi 2007 up to this day. I have searched information over the internet and found out that I should use a CookieManager? The thing is that I am not using any in

TIdMessage - Attachments Show Up in Body as Base64

那年仲夏 提交于 2019-12-23 05:22:50
问题 I'm working on sending emails via SMTP using the Indy components ( TIdMessage ). Such an email needs to be HTML, and needs to carry attachments. Now if I send an email as plain text ( ContentType := 'text/plain' ), and attach a file, the email sends just fine, attachment found and everything. However, once I change the ContentType to text/html , I have a very bizarre result. The entire body of the email gets replaced with apparently the underlying email data (in my words), and shows the

How do I forward request to another proxy server using TIdHTTPProxyServer (proxy chain)

孤街浪徒 提交于 2019-12-23 03:47:32
问题 currently I want to make my indy proxy server forward the request to another proxy server. I have found this link and made a try by myself. But my code does not work without any error message as if I had made no change. My code is as below in C++ XE2. void __fastcall TForm3::MyProxyHTTPBeforeCommand(TIdHTTPProxyServerContext *AContext) { TIdIOHandlerStack* tempIO = new TIdIOHandlerStack(NULL); TIdConnectThroughHttpProxy* tempProxy = new TIdConnectThroughHttpProxy(NULL); tempProxy->Enabled =

how to lookup dns records with indy in delphi

北城以北 提交于 2019-12-23 03:38:34
问题 How can I lookup DNS records with Indy in Delphi? For example, SRV records, SPF records, TEXT records, etc. I know we can use nslookup directly from Windows, but I want to do this with Indy, or any other Delphi component. I tried searching Google, and I found something like this: function ReverseDNSLookup(IPAddress: String; DNSServer: String = SDefaultDNS; Timeout: Integer = 30; Retries: Integer = 3) : string; var AIdDNSResolver: TIdDNSResolver; RetryCount: Integer; begin Result := '';

Delphi XE3 indy compatibility issue between tbytes and tidbytes

风格不统一 提交于 2019-12-23 01:11:30
问题 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

Delphi XE3 indy compatibility issue between tbytes and tidbytes

自作多情 提交于 2019-12-23 01:11:12
问题 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

Delphi: TIdHTTP vs TNetHTTPClient

走远了吗. 提交于 2019-12-22 17:59:23
问题 I'm writing a download manager in Delphi with some custom features like resumable downloads and downloading through proxies. I'm studing different component solutions: Indy and NetHTTP, both seem very close. TNetHTTPClient seem to be an interface of winhttp.dll . TIdHTTP seem to be an interface of wininet.dll (but i'm not sure). TIdHTTP seems like a very old component (maybe very stable/tested) and has tons of documentation online. TNetHTTPClient seems to be a very recent component, and doesn