indy

TCP Keep Alive on idHttpServer (server) and wininet (client)

孤者浪人 提交于 2019-11-28 04:26:36
问题 I have a webserver application developed using idHttpServer. When a client connects do my webserver and, for some unknown reason, got disconnect (not a gracefully disconnect) my webserver does not get notified. I know this is the normal behavior but I need to know when the client dies. There are a few ways of doing this. I know 2 good ways: 1 - Implement a heart beat mechanism. The client socket notifies the server that it is still alive (need some work and some code to make it works) 2 - TCP

Delphi XE4 Indy compatibility issue between TBytes and TidBytes

旧街凉风 提交于 2019-11-28 03:49:15
问题 Today I try to compile my XE3 project in XE4. First problem that I face is with Indy's FTCPClient.Socket.ReadBytes() method. Before it was accepting TBytes type, now it insists on TidBytes. Definitions: TIdBytes = array of Byte; TBytes, Im not sure I guess it is generics something like TArray which is array of Byte. Question number 1: Why does compiler complain by saying that'[dcc32 Error] HistoricalStockData.pas(298): E2033 Types of actual and formal var parameters must be identical'. As I

Indy FTP Failing to upload miserably

夙愿已清 提交于 2019-11-28 01:22:39
Using a simple code, such as: procedure TForm1.cxButton1Click(Sender: TObject); begin ftp.Host := 'domain'; ftp.Username := 'user'; ftp.Password := 'password'; ftp.Connect; ftp.Put('C:\_Projects\testpicture.JPG'); ftp.Quit; ftp.Disconnect; end; I'm getting the following results: Application freezes while uploading (ergo unable to see Progress Bar position). Uploaded file goes corrupted (corrupts anything more than a few bytes). What on earth am I doing wrong? Thank you. The app freezes because Indy uses blocking operations. While the code is running, the main message loop is not running, so

Is it possible to use Indy 10.5.8.0 in Delphi XE and DataSnap?

谁说胖子不能爱 提交于 2019-11-27 23:10:08
The case I'm trying to update the INDY to the latest version for my Delphi XE (Update 1), so I downloaded the latest INDY10 file (Indy_4545.zip) from indy.fulgan.com/ZIP . The packages compiles successfully and I can now even see the new version 10.5.8.0 on the about box dialog, but after a IDE restart I got a message saying: No se encuentra el punto de entrada del procedimiento @Idhttp@TIdCustomHTTP@GetRequestHeaders$qqrv en la biblioteca de vínculos dinámicos IndyProtocols150.bpl. My free translation to English: Entry point not found for procedure @Idhttp@TIdCustomHTTP@GetRequestHeaders$qqrv

Proxy server using Indy

时间秒杀一切 提交于 2019-11-27 20:41:41
I'm new to Indy and I want to build a simple proxy-server with it. This is a quite big library, and I just don't know where to start. When client connects to server, OnExucute fires up and receives client connection as parameter (AContext.Connection). I want to do following: [client connection] := AContext.Connection read host/port from [client connection] [remote connection] := connect to host/port while both connections alive: if data available in [client connection]: read data from [client connection] write data to [remote connection] if data available in [remote connection]: read data from

How to use a dll outside of the system path

≡放荡痞女 提交于 2019-11-27 19:50:40
I made an application that uses the openssl dlls ( libeay32.dll and ssleay32.dll ). It is indy using them, I don't call the dlls directly. The simplest workaround i found to avoid an installer (i just delpoy an exe and i am ok with this approach) is to: put the dlls as resources of the exe on program start I extract them in the exe folder the exe uses them This is perfect but I would like to improve the approach by extracting the dlls in a temp folder and not on the exe folder (that in many cases is the desktop). The problem is that I don't know how to force the application to use the dlls in

Delphi (XE2) Indy (10) Multithread Ping

情到浓时终转凉″ 提交于 2019-11-27 19:10:51
I have a room with 60 computers/devices (40 computers and 20 oscilloscopes Windows CE based) and I would like to know which and every one is alive using ping. First I wrote a standard ping (see here Delphi Indy Ping Error 10040 ), which is working fine now but takes ages when most computers are offline. So what I am trying to do is to write a MultiThread Ping but I am quite struggling with it. I have seen only very few examples over the internet and no one was matching my needs, that's why I try to write it myself. I use XE2 and Indy 10 and the form is only constitued of a memo and a button.

Delphi - SSL TCP communication with Indy components

岁酱吖の 提交于 2019-11-27 19:05:46
问题 I'm using the TIdSSLIOHandlerSocketOpenSSL Indy component in Delphi XE2 to send data to an SSL server (Apple Push Notification Service) over TCP. I've got it working to a degree but not sure if I'm going about it the best way. I'm doing the following : Set the SSL properties inc. path to certificates Call the .Open method to open the connection Check the AType parameter in the OnStatusInfoEx event until I get a 'Handshake Done' Send the data using .WriteDirect Close the connection with .Close

Using Gmails Outgoing SMTP from DELPHI(Indy) using TLS

十年热恋 提交于 2019-11-27 17:37:35
问题 I am using INDY to send Email using the SMTP client on port 25 with no problem. Now I need to send an Email using a Gmail account and for that I need to use TLS. Can anyone provide a simple sample on how to do that. Thanks 回答1: This code works for GMail: begin IDSMTP1 := TIDSMTP.Create; IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create; try with IDSMTP1 do begin Host := srvr.Host; Port := srvr.Port; if (srvr.needAuthentication = 'Y') then AuthType := satDefault else AuthType

Indy 10 TCP server

别说谁变了你拦得住时间么 提交于 2019-11-27 15:19:02
问题 After a lot of searching I thought Indy TCP server would be the best to use on Instant messenger server I am working on. The only issue I am facing right now is broadcasting and forwarding message to other connected client, sending back response to the same client seems ok and doesn't hangs up other clients activity, but for forwarding message to other clients the mechanism that I know of is by using the aContext.locklist , and iterating between the connection list to find the client