indy

Indy error 10038 “Socket operation on non-socket” after 61 seconds of inactivity

女生的网名这么多〃 提交于 2019-12-01 12:29:34
问题 I want to download some large files (GB) from an FTP server. The download of the first file always works. Then when trying to get the second file I get: "Socket Error # 10038. Socket operation on non-socket." The error is on 'Get'. After 'Get' I see these messages (via FTP status event): Starting FTP transfer Disconnecting. Disconnected. The code is like this: {pseudo-code} for 1 to AllFiles do begin if Connect2FTP then begin FTP.Get(Name, GzFile, TRUE, FALSE); <--- Socket operation on non

How to add a “Authorization=Bearer” header with Indy in Delphi?

北城余情 提交于 2019-12-01 10:58:29
I'm trying to do a POST request using an access_token, and it works fine using POSTMAN, but when I try to do the same request on Delphi, I can't find a way to add the "Authorization=Bearer eyxxxxxx..." to the Request header, as POSTMAN does. POSTMAN Request (working well): POST /somepath HTTP/1.1 Host: someurl.com.br Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..... Content-Type: application/json (body content ommited) Indy Request generated by Delphi, captured by HTTP Analyzer (always returning 401 Forbidden error, because the absence of "Authorization=Bearer" part): POST /somepath HTTP/1.1

Why am I getting “Connection reset by peer” with Indy only on a HTTPS (SSL) site?

自古美人都是妖i 提交于 2019-12-01 10:32:46
问题 I am trying to use Indy HTTP (Delphi Seattle) to get the contents of a https webpage and I always seem to get Error 10054 - Connection reset by peer. Other sites seem to work just fine. The website in cause is https://www.adultwork.com . I have added the SSL, Cookie and Compressor components, but maybe I'm missing something, some settings, IDK... If anybody could help, it would be greatly appreciated. 回答1: I was able to reproduce the issue, and it is due to Indy's TIdIOHandlerSocketOpenSSL

How to continuously send messages with TIdTCPServer?

纵然是瞬间 提交于 2019-12-01 07:55:47
I need to create a delphi application where when it's started the server is started as well and starts sending messages immediately, but I haven't found an example or tutorial and the nearly 5000 page Indy manual doesn't make it clear to me how I can do this... This example uses a Delphi 2009 VCL application with a main form, which contains only one visual component, a TMemo named “MemoLog”. Client and server are both started in the FormCreate event. Note that the client code does not handle connection loss, but this can be implemented with a separate re-connect loop within the thread.

ssl v3 poodle and move to tls with indy

久未见 提交于 2019-12-01 06:37:24
As you know the new poodle is in town, Witch barks got Twitter, Cloudflare to drop support to SSL3. The Indy(TidHttp) 10.6.0.0 revives this nice exception: EidOsslUnerlayingCryptoError message 'Error connecting with SSL. error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure' My question is what is the definition required to handle TLS? update: here is a code that throw the exception: full working code. var parameters:TStringList; keySecretBase64:string; stream:TStringStream; IdEncoderMIME1 : TIdEncoderMIME; idHttp1 : TIdHTTP; IdSSLIOHandlerSocketOpenSSL1

Can I use IdUDPClient to send M-SEARCH request?

为君一笑 提交于 2019-12-01 05:54:57
There are few uPNP devices in my network. I am trying to send M-SEARCH request to the network and hope receiving some responses from it. This is what I am trying: var sIP, sOut: string; iPort: Word; S: TStringBuilder; begin S := TStringBuilder.Create; try S.Append('M-SEARCH * HTTP/1.1').AppendLine .Append('HOST: 239.255.255.250:1900').AppendLine .Append('MAN: "ssdp:discover"').AppendLine .Append('MX: 10').AppendLine .Append('ST: ssdp:all').AppendLine; IdUDPClient1.ReceiveTimeout := 3000; IdUDPClient1.Broadcast(S.ToString, 1900, '239.255.255.250'); sOut := IdUDPClient1.ReceiveString(sIP, iPort)

Can I use IdUDPClient to send M-SEARCH request?

♀尐吖头ヾ 提交于 2019-12-01 04:45:43
问题 There are few uPNP devices in my network. I am trying to send M-SEARCH request to the network and hope receiving some responses from it. This is what I am trying: var sIP, sOut: string; iPort: Word; S: TStringBuilder; begin S := TStringBuilder.Create; try S.Append('M-SEARCH * HTTP/1.1').AppendLine .Append('HOST: 239.255.255.250:1900').AppendLine .Append('MAN: "ssdp:discover"').AppendLine .Append('MX: 10').AppendLine .Append('ST: ssdp:all').AppendLine; IdUDPClient1.ReceiveTimeout := 3000;

INDY 10 TCP Server - Combine with non thread safe VCL Code

ε祈祈猫儿з 提交于 2019-12-01 04:12:34
问题 VCL is not thread safe. Therefore I guess it is not a good idea to write information to the gui in the INDY 10 TCP server.execute(...) function . How to send information from the server execute to the VCL ? I need to modify a TBitmap inside a tcpserver.execute function. How to make that thread safe ? 回答1: Write stuff to the VCL thread from Indy the same way to write stuff to the VCL thread from anywhere else. Common options include TThread.Synchronize and TThread.Queue . Modifying a

Does Delphi XE2 FireMonkey support Indy for cross-platform apps?

怎甘沉沦 提交于 2019-12-01 03:56:37
Looking at the new Delphi XE2 with Firemonkey. Considering that it compiles for Windows, Mac OSX and iOS, VCL components are useless in a FireMonkey application. My question is: Is there/will there be an Indy Firemonkey Edition? Cause I seriously need the IdHTTP.Post(); . If not, is there a way to do this in FireMonkey? I have been googling for quite awhile now, not finding anything. :S VCL means Visual Component Library . There's nothing about Indy that is "visual" (meaning "seen at runtime"), meaning that "VCL components are useless in a FireMonkey application" has no relevance to Indy . You

Delphi Indy - How to get SSL certificates for a SSL-TCP Client/Server link with Indy 10

自古美人都是妖i 提交于 2019-12-01 02:11:48
I'm completely new to SSL and these ciphering stuff but I need to make communicate client and server Delphi XE6 apps running on mobile devices. The TCP communication has to be safely ciphered. To start, I simply wrote the Delphi/Indy TIdTCPServer/TIdTCPClient based Win32 client and server exchanging strings. (Issued from the indy10clieservr demos found on SourceForge: svn://svn.code.sf.net/p/indy10clieservr/code/1_sample Simple String Exchange) I tried to modify them to cipher the communication by adding a TIdServerIOHandlerSSLOpenSSL component on the Server, and a TIdSSLIOHandlerSocketOpenSSL