Hi
I have Delphi 10.2.3. Past week I downloaded my IW Key and last version (IW 14.2.8). I've tried to run some of the sample projects, but for all of them I get a blank page, without any error.
If I install an old version (IW 14.1.12) the samples runs fine, and my test applications as well.
I apologise if this is a trivial question. I have looked in the documentation (the PDF is copyrighted 2006 so I am unsure of the currency), done the usual web searches, stack overflow etc, but nothing definitive. There are numerous parts of the documentation that say:
Quote:Additional code changes may be required to maintain cross platform compatibility, as discussed in previous sections.
I'm note even sure what that means.
Regardless, I have a third party component that uses Indy. I have asked the vendor whether it is cross platform. His advice is that 'his' code is cross platform, but he uses INDY and INDY is not cross platform. INDY uses
Quote:The component is not compatible with Firemonkey as it uses DLL files form Indy and the DLLs aren't cross-platform.
To which I replied:
Quote:According to StackOverflow, INDY works with FMX (and in my case macOS) and has for some time. Since there is nothing visual the VCL doesn't get invoked (this is from 2011).
Quote:Indy ships with the IDE (and has since D6) so there is nothing extra to buy if you already have XE2 installed. Also, Indy is open-source, so you can upgrade an Indy installation using source code from Indy's public access SVN server or mirror. Regarding FireMonkey, Indy does work in FireMonkey. Indy uses whatever the native socket API is on a given platform (WinSock on Windows, Posix on Mac, libc on Kylix, etc).
The only known gotcha with Indy under FireMonkey at the moment is the TIdAntiFreeze component is not available at design-time. The IDE cannot resolve it correctly due to the non-standard way it is packaged (to be adressed in Indy 11). You can instantiate it programmably in code at run-time, though.
To which he replied:
Quote:Indy works with Firemonkey, although the 2 DLL files included (ssleay32.dll, libeay32.dll) aren't cross-platform.
So I have been having a discussion with a vendor who is simply a user of INDY and I don't think he quite has all of the knowledge. Further, whilst his code might work with FireMonkey, it will only do so in Win32 mode, he uses Registry and other windows dependent units AFAICT.
Regardless, and so my (apologetically trivial) question: Is INDY (latest version) Cross Platform, ie. can I use it in my application that is to be deployed on macOS? and if so, is there anything 'special' I would need to do?
For the record, his USES clause contains these references to INDY components:
My multi-threaded program uses TidIMAP4 to access Gmail's IMAP server with OAuth 2 authentication.
My computer's network environment is a little complex - here we have the GFW blocking overseas services including Gmail, so the program connects through OpenVPN(through stunnel) and ShadowSocks proxy.
The setup works for other programs including Chrome, etc.
With the setup my program's thread 2 had several successful login, but most of the time, it fails to connect with the 'EIdSocketError: Socket Error # 10060 Connection timed out.' error.
With TIdLogEvent I can see that there is no data coming in and out. And this is thread 2, but thread 1 is ok - it can connect, login, select mailbox, and so on.
the logic works like this: thread 1 login and download folder/label list, email IDs, and so on, when done, it pushes the downloaded data to a queue and several instances of 'thread 2' will start to login. And the above described error happens in 'thread 2'.
I know the issue might come from the GFW, but the strange thing is why 'thread 1' can login but 'thread 2' fails? They login with the same function and same parameters.
I intend to diagnose with Wireshark, but don't know how to setup after trying many kinds of setup.
Any hints or suggestions? Thanks.
PS, the program most of the time works with direction Internet connection on a remote windows VPS which is located in the US, but still sometimes it gets the "EIdReplyIMAP4Error" exception
I have an IntraWeb SA application. If the user closes a session I want to get the count of the remaining sessions.
I call "gSessions.getCount" in TIWServerController.IWServerControllerBaseCloseSession method.
Then my application hangs.
Code:
procedure TIWServerController.IWServerControllerBaseCloseSession(aSession: TIWApplication);
var
nCount : integer;
begin
try
nCount := gSessions.getCount;
except
end;
end;
How could I get the number of the remaining sessions at this point?
When I build my project in Lazarus 1.8.4 (FPC 3.0.4) I always get warnings from IdFTP.Quit calls being deprecated.
Code:
Compile Project, Target: bin/AGILicMgr: Success, Warnings: 2
AGILicMgr.dpr(262,20) Warning: Symbol "Quit" is deprecated
AGILicMgr.dpr(269,15) Warning: Symbol "Quit" is deprecated
This is the first warning location:
Code:
if IdFTPtfr.Connected then
begin
IdFTPtfr.Quit; // <== Warning here
end;
But I have looked at the on-line documentation where there is no sign of any deprecation...
What gives? Is the IndyLaz package installed via OnLinePackageManager somehow broken?
The further effect of this problem is that there are no tool-tips for the IdFTP component, when I press period after the IdFTP variable Lazarus just displays this in the message box:
Code:
Codetools, Errors: 1
IdGlobal.pas(1889,105) Error: expected ;, but deprecated found
And no popup in the editor suggests any valid command.
I have an extremely simple SmtpServer set up to simply receive emails and write them to disk. My problem is that over several hours the number of active threads just keeps growing, leading me to believe they are not being freed correctly. I further have to conclude it is quite likely as a result of something I am doing or not doing that is causing this, however for the life of me I cant seem to identify the problem.
I have attached my sources, they do contain an external reference to a text file logging routine that is thread safe (file protected by critical section) that has been used without issue for many years.
In my current setup I am binding to 20 IP addresses and they all seem to receive and handle the incomming email as expected. The load on the system is between 1 and 5 messages per minute. after 24 hours there are well over 1,000 threads active, this would not be all the threads created (fewer than messages received) in that period.
By my speculation my error should be in my configuration of the component
with WwolSmtpServ do
begin
ReuseSocket := rsTrue;
AllowPipelining := True;
ServerName := 'WWOL SMTP server';
DefaultPort := 25;
ListenQueue := 50;
MaxConnections := 0;
MaxMsgSize := 0;
TerminateWaitTime := 500;
UseNagle := True;
UseTLS := utNoTLSSupport;
end;
OR in my component exception handlers
procedure TdSmtpServ.WwolSmtpServException(AContext: TIdContext; AException: Exception);
begin
try
if ((AException is EIdConnClosedGracefully) or (AException is EIdNotConnected)) then
begin
Exit;
end
else
begin
if AContext.Connection.Connected then
begin
Log(Now, 0, 1, AContext.Binding.IP, AContext.Binding.PeerIP, AException.ClassName, AException.message + ' - ' + ' SmtpServException still connected');
AContext.Connection.Disconnect;
end
else
Log(Now, 0, 1, AContext.Binding.IP, AContext.Binding.PeerIP, AException.ClassName, AException.message + ' - ' + ' SmtpServException disconnected');
// AContext.Connection.Disconnect(False);
end;
except
on E: Exception do
begin
dmMain.TextLog('WwolSmtpServException : ' + E.Message);
dmMain.TextLog('WwolSmtpServException : ' + AContext.Binding.IP + ' : ' + AContext.Binding.PeerIP + ' : ' + AException.ClassName + ' : ' + AException.message);
end;
end;
end;
I have a Delphi console project I am porting to Linux using FreePascal 3.0.4 and Lazarus 1.8.4.
It uses Indy10 email and FTP components with OpenSSL.
The port is towards Ubuntu Linux on x86_64. So it is now a 64 bit program.
I installed the IndyLaz package for Indy10 via OnlinePackageManager in Lazarus and it seems like it accepts all of my Indy calls during compile.
But this Delphi project relied on two dlls (libeay32.dll and ssleay32.dll) for SSL to operate on Windows.
Do I need to put some corresponding Linux binaries into my project directory and if so where can I get them?
Or is the fact that I installed OpenSSL into Ubuntu enough for Indy10 to be able to use SSL?
I have not yet reached the point where I can test run the application since it needs specific email data to work from.
EDIT after being able to test run application
It turns out that the SSL connection apparently needs something extra in Linux...
I am getting the following exception when connecting to the mail server to retrieve email using POP3:
Followed by this when I click No twice:
This happens in this code section:
Code:
try
IdGetMail.Connect; // This is an IdPop3 object. Exception thrown here
MailCnt := IdGetMail.CheckMessages;
if MailCnt = 0 then {Nothing to process}