Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Sherlock

    Interesting article about dying languages

    I knew my job should have been "son". But nooo, I had to go and learn something useful.
  3. Lars Fosdal

    How to get Linux installed?

    It is truly tragic that Linux is not available for the Pro SKU. It should even have been in the Community version IMO. Imagine the potential plethora of code coming from open source projects.
  4. Today
  5. Angus Robertson

    Need Synchronous SslSmtpClient

    Look at the new TIcsMailQueue component added to ICS earlier this year, it does exactly what you need. You can queue hundreds of emails at the same time, and they will be sent and retried over several minutes or days. The component is described half way down the page at http://wiki.overbyte.eu/wiki/index.php/ICS_V8.60 Angus
  6. Angus Robertson

    Studying TSslHttpAppSrv

    Not sure why you want to run the server in a thread, that just listens on one or more ports and creates clients. Running the client in a thread can be done, ICS has TWSocketThrdServer that does exactly that, but it is rarely used, has not been updated for 10 years, lacks newer multi-listen and SSL stuff and there is no web server derived from it, lack of demand from end users. My own TSslHttpAppSrv SQL driven web server runs happily in a single thread, the SQL stored procedures rarely take very long so are not blocking others users significantly, obviously this depends on volume, I'm only handling couple of thousand SQL requests a day, from the logging, SQL proc took 16ms, 31ms, 141ms, 63ms, 390ms, 16ms. So I never bothered with threads. As Francois says, using a thread just for the database lookup and returning the page in the main thread is the safest solution, look at class TClientProcessingThread in the ICS FTP server which uses a thread to calculate MD5sums and directory listing, Angus
  7. Ian Branch

    PopMenu two levels down..

    Aaaaarrrrrggggghhhhh!!!!!! For 3 days I wrestled with the issue, narrowing it down to the Main Menu configuration. It was repeatable. From the Main menu line call it didn't work. From a sub menu call, it worked. Every time...... Hence this thread. I just went to create a small test app to demonstrate it. Couldn't make it fail. Huh? Scrapped it and started again. Nope. Didn't fail. Hmm. Goes back to the original app that I had the issue in......You guessed it, it now works, either way.?????? Apologies to any and all for any stress. I'm going to go and have a Scotch and ponder the meaning of life....More like to get the answer to that than to this..... Regards & tks for your support, Ian
  8. Uwe Raabe

    Interesting article about dying languages

    Perhaps that big company is run by the fathers of those Tom, Dick an Harry and they trust their kids more than the experts?
  9. Ian Branch

    PopMenu two levels down..

    Hi Uwe, VCL, Win 32. I'll see about a small demo. Ian
  10. Uwe Raabe

    PopMenu two levels down..

    Is this VCL or FMX? Which target platform? Can you provide a minimal example showing that?
  11. Sherlock

    Interesting article about dying languages

    Every Tom, Dick and Harry can up a small "Hello World" like project in any new language to GitHub, just to test it. So whenever a groovy new language is out, people with nothing else to do will do just that, making said new language "popular". What bugs me most is this "big company X invented this awesome and totally new language for their project Y because they couldn't have done it without it" meme. Which is just silly. First of all that new language will be just another dialect of some existing language, and secondly in what hell is that a reasonable approach to getting things done kissed and dry?
  12. FPiette

    Studying TSslHttpAppSrv

    You should create a worker thread for the lengthy database operations and keep your TCoreWebServer run in his own thread. Having the database thread will transform blocking database operation into non blocking one which will nicely fit into the ICS stuff. Having specialized database thread will also be easier to develop and debug.
  13. You'd better replace your loop by an event chain. This is easy to do once you understood event driven programming. This being said, you can make a synchronous version by using a wait loop. This will waste CPU...
  14. Would it be possible to get a synchronous version of the SslSmtpClient? I have a process that loops through orders and sends emails so I need it to complete before going to the next order. As it is, I can only do one at a time and the user has to click Send Email multiple times to send all of them. Thanks.
  15. PeterPanettone

    Add a system-menu item to all applications?

    Thank you very much!! I am sorry for my late answer, I was away for a personal issue. PS: How can I show you my gratitude? May I send you a small donation?
  16. Hi, I'm using TSslHttpAppSrv in a Delphi Rio project. I'm following the example and I manage to build my AppServer. Very cool! There are some points that I would like to understand better and maybe improve a little. I create a "TcoreWebServerThread" derived from TThread that creates an instance of TcoreWebServer. TcoreWebServer is a descendant of TSslHttpAppSrv. I hooked event_ClientConnect to OnClientConnect. procedure TcoreWebServer.event_ClientConnect(Sender, Client: TObject; Error: Word); var lRemoteClient : TcoreWebServerClientConnection; begin lRemoteClient := TcoreWebServerClientConnection(Client); lRemoteClient.WSessionCookie := 'dhsWeb_' + lRemoteClient.HostTag+ '_'+ Port; lRemoteClient.OnBgException := event_ClientBgException; fLogRequest[ lRemoteClient.WebLogIdx ].logFmt('Thread ID %d',[ThreadID]); end; This Connection is created in the context of coreServerThread. That same Thread will handle the Authorization, Permission and the URLHandler. It is too much for the server thread to handle, specially because Authorization (custom) and Permission will be checked against Database. Most of my TURLHandler descendants will also query a Database. Some will be slow ( Reports or Large data transfers). I must use a separate thread. And here's the problem. Where is the best place to create that thread? I haven't found a way to create the client connection in another thread. In the event_ClientConnect I would like "client" parameter to be in its own thread. This way all Authorization, Permission and TURLHandler execution would happen without blocking the main WebServer thread. Once I create the Client in a it's own thread context, I need to handle my Database Connection. I derived a class from TWebSessionData called ( TcoreWebServerWebSession ) : TcoreWebServerWebSession = Class( TWebSessionData ) private FLoginChallenge: String; FUserCode: String; FLastRequest: TDateTime; FRequestCount: Integer; FLogonTime: TDateTime; FIP: String; FSQLConnection: IcoreSQLConnection; public constructor Create( aOwner : TComponent ); override; property UserCode : String read FUserCode write FUserCode; property LogonTime : TDateTime read FLogonTime write FLogonTime; property RequestCount : Integer read FRequestCount write FRequestCount; property LastRequest : TDateTime read FLastRequest write FLastRequest; property IP : String read FIP write FIP; property LoginChallenge : String read FLoginChallenge write FLoginChallenge; property SQLConnection : IcoreSQLConnection read FSQLConnection; End; The property SQLConnection is an interface, and it's life time will be different from the WebSession's. I would like to return the SQLConnection back to its pool as soon as the user request is done. ( All the database connection pooling is already done! ). All the requests will return a JSON object. So, basically I need to place the ClientConnection on a separate thread that will Acquired a Database Connection from a pool and assign it to coreWebServerWEbSession.SQLConnection. This connection will be used to Authorize, Check permission and execute TURLHandler. Once Finished I would like to release it back to it's pool. No bad for a Sunday brainstorm TIA, Clément
  17. Yesterday
  18. Ian Branch

    PopMenu two levels down..

    Hi Attila, That's one interpretation. Or, it could mean that it is the only environment I am working in and have experienced the problem and that I can make the issue happen at will in my working environment. ;-) Ian
  19. Attila Kovacs

    PopMenu two levels down..

    This means you have tested with other versions too, and it's only happens in 10.3.2?
  20. Ian Branch

    PopMenu two levels down..

    Hi Team, An interesting observation.. D10.3.2. Win 10. Main Form with a MainMenu. If I call Form 1 from the MainMenu top line option, lets call it 'Form 1', using "TForm1.Create(nil).ShowModal;", and then from Form 1, call Form 2 with a TButton using "TForm2.Create(nil).ShowModal;", and then try to have a PopMenu appear in Form 2, it doesn't/won't. If, however, I repeat the above but make the initial call from a MainMenu sub-menu, Form 1|Form 1', then the Popup menu works in Form 2. This is repeatable. Is this normal or a bug? Regards, Ian
  21. u666sa

    JCL & JEDI in 10.3.2 RIO (no GetIt)

    I can't seem to install neither JCL nor JEDI. When I click on install.bat I'm getting error messages. Using GetIt is not an option, so forget it, I can't use it. I do have 10.2.3 Tokyo installed on this system, haven't removed it yet, could that be the reason for my problems? What do I do to get this thing installed?? =================================================================== Compiling JediIncCheck... Using Embarcadero RAD Studio 10.3 Embarcadero Delphi for Win32 compiler version 33.0 Copyright (c) 1983,2018 Embarcadero Technologies, Inc. 67 lines, 0.03 seconds, 123876 bytes code, 28636 bytes data. The "source\include\jedi\jedi.inc" include file is outdated. You can download the newest version from https://github.com/project-jedi/jedi An error occured while compiling the installer. Installation aborted. Для продолжения нажмите любую клавишу . . .
  22. FredS

    Add a system-menu item to all applications?

    Some of Hooks-Made-Easy updated and now on GitHub.
  23. Eli M.

    How to get Linux installed?

    Do you have Enterprise or Architect? It isn't in Pro or Community. For FMXLinux you have to install that off of GetIt.
  24. Rollo62

    Interesting article about dying languages

    Nice visualization. Like always with such statistical data one should ask where does this come from ? How does GitHub evaluate "popularity" ? Isn't "popularity" just high because you can do small tasks easily ? Maybe such popularity index must be weighted against the complexity of projects as well. This also gives a clue to what developers maybe really like, as its seems to be a kind of simplifications in the language itself (JS amd Python). Anyhow, I don't really agree on this, as typed languages has a much practical benefits. Easy-to-learn is maybe not the only core feature of popular languages. From my experience, the languages are more or less irrelevant, but the libraries and frameworks do. I like all C languages, because they are "readable" for me, as C++ developer, although there are still many different features in each of them. Aren't JS/Python not only that popular because of their fantastic libraries and frameworks out there ? For me the key benefit of a language is not to support all small features like Nullable or Inline variables (nice to have, but not mission critical), but most important for me are stable and effective frameworks (VCL/FMX), encapsulating the complexity of the real world underneath. Regarding Delphi I would like to ask: Why can't I use ALL the core libraries of the modern OS, like beacons, sensors, ARKit, etc. etc. at 100% yet ? If so, there would be no need to move to Swift, JS or C#, only because I need to solve a special task, unreachable from FMX right now. Same for VCL and WinRT, but the situation is much more relaxed there, from the history of Delphi. Maybe I'm wrong, and there are different opinions for sure, but I would put most efford on building infrastructure and quality around libraries, instead of trying to follow the last hype in language theory. The "ease-of-use" is not by leaning only 20 keywords instead of 40, but to be able to use powerful libraries that encapsule all OS features in a nicely, cross-platform way, which are easy to learn, self-explaining, consistent, powerful and error-free. Furthermore to have powerful debugging tools as well, around this infrastructure.
  25. David Schwartz

    How to get Linux installed?

    I've tried everything to install Linux support into 10.2.3. It's just not there. Someone in another thread I posted said to use the ESD installer. Well, it runs for about 5 minutes and seems to leave out a TON of stuff no matter what I check. The ISO runs for 45 minutes, and even though it shows the same thing that the ESD installer shows for customizing the install, it never installs Linux support. There's no way the ESD installer is pulling all the same files down over the internet as the ISO has sitting right in memory in a fraction of the time. I don't understand why there's a difference between what the ISO installs and what the ESD installs, but when all the installation files are sitting right there in memory when attached to the ISO, it makes no sense to download all the stuff from the internet or that the ISO is incapable of installing part of the system. I'm removing Delphi 10.2 entirely from my machine and flushing the registry entries. Now, is it possible to install from the ISO -- FROM SCRATCH -- and get the Linux stuff installed? If so, how? If not, how can I get everything to install from the ESD including the Linux support? Maybe I'm missing something obvious, but this disparity between installers is driving me nuts.
  26. Last week
  27. David Schwartz

    Interesting article about dying languages

    Very cool!
  28. Angus Robertson

    SChannel TLS - perform TLS communication with WinAPI

    ICS support Delphi 7 onwards so we avoid any language features or libraries added after that, or have our own versions of them, such as ANSI or Wide5tring functions. Users tell me quickly if I accidentally do something that Delphi 7 does not support so it is still used. Angus
  29. Remy Lebeau

    UCS4Strings

    Despite its name, UCS4String is not actually a native string type, like (Ansi|Raw|UTF8|Unicode|Wide)String are. It is just a dynamic 'array of UCS4Char', so a null UCS4Char is added to the end of the array to allow for null-terminated-string semantics, ie you can type-cast a UCS4String to PUCS4Char and iterate the string up to the null terminator, just like any other null-terminated P(Ansi|Wide)Char string. UCS4String was introduced way back in Delphi 6 (when UTF8String was first added as just an alias for AnsiString), so it couldn't be added as a true native string type back then. They never made UCS4String into a native string type, even though the RTL is now flexible enough to support a native string with 4-byte characters. All of the necessary plumbing was added in Delphi 2009 when UnicodeString was first introduced and UTF8String was turned into its own unique string type. UCS4String could easily be made into a native string type now, if they really wanted to. They probably haven't done so yet because UCS4String is very seldomly used by anyone, so they likely didn't want to waste development resources on it. Yes, because Length() is simply returning the full array length, which includes the null UCS4Char at the end.
  1. Load more activity
×