Jump to content

Clément

Members
  • Content Count

    380
  • Joined

  • Last visited

  • Days Won

    4

Clément last won the day on December 31 2023

Clément had the most liked content!

Community Reputation

148 Excellent

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

5309 profile views
  1. I'll fix the code and take a look at the component. Thanks
  2. Hi, I'm using 12.1 with ICS 8.69. This code is driving me nuts. procedure TDiscoverClient.event_ServerReply(aSender: TObject; ErrCode: Word); const _BufferSize = 1024; begin if errCode = 0 then begin var lBuffer : Tbytes ; var lFromSock : TSockAddr; var lFromLen : Integer; var lCount : Integer; SetLength( lBuffer, _BufferSize ); lcount := fSender.ReceiveFrom(@lBuffer[0], _BufferSize, lFromSock, lFromLen ); if lCount>0 then begin if Assigned( fOnHostFound ) or Assigned(fOnHostAlive) then begin var lRespParts := SplitString( TEncoding.ANSI.GetString( lBuffer,0,lCount ),':'); var lServerMachineName := ''; var lServerMachineIP : String := String(inet_ntoa(lFromSock.sin_addr)); if lRespParts[0] = 'M' then lServerMachineName := lRespParts[1]; if Assigned(fOnHostFound) then fOnHostFound(Self, lServerMachineIP,lServerMachineName ); if Assigned(fOnHostAlive) then fOnHostAlive(Self, lServerMachineIP,lServerMachineName ); end; end else fErrMsg := Ics_WSAGetLastError; end; end; The code is executed from a child form, from my main VCL application. I need to check if a UDP server is alive ( or found). Anyway, I always get 2 times lCount = -1, and fErrMsg is assigned 10014 both times, the 3rd times it works and shows correctly the expected information. I tried several combinations to allocate lBuffer, and every one fails with 10014 the first 2 times, and the third is goes. The client machine, where this code runs, has only IPv4 active. The UDP server runs both IPv6 and IPv4, but is only bound to Ipv4 at 0.0.0.0 Can someone shed some light? TIA, Clément
  3. Hi, I'm using Delphi 12 for this one. There are several Window Services applications working in a lot of different tasks. For example: A Schedule service, with thread managers and worker threads execute tasks at specific times. A Communication Service, with several thread managers, each with it's own sets of working threads which handles communication with TCP (or UDP) devices. A Batch service with several thread managers, each with a set of working threads which handles batch... Well as the application grew over the years, there are more and more thread managers handling more and more workers.... Sometimes Sht hits the fan, and some threads just stops responding. Sometimes it's a worker, which might be replaced by the manager, but sometimes it's a manager thread that goes bananas. I would like to write another service, a thread monitoring service, where I want to "send somehow" a heartbeat from each worker thread ( from all the other threads ). I want to know when a worker thread went bananas, but mainly when a manager threads goes bazinga. Some of the errors we detected: out of memory, out of disk space, file is used by another process ( usually anti-virus), SQL query Error ( invalid customer data ), SQL Query error ( invalid instruction ), Server Database went in maintenance mode, Database not available (communication lost, disk is full, backup taking to long), Bad Windows Server Patch , Windows update, and the list goes on and on. All the above describes actually problems that leads a worker or a manager to fail. Sometimes we can track what happened and reply our SLA in time. But sometimes it's just a nightmare. Nobody did anything and nobody changed anything... I guess I want the safest IPC in this context. For this to work, the worker thread cannot freeze while sending a heartbeat. For know, just knowing what thread stopped will be enough. I suspect a lot of things, but even with a lot of logs sometimes is very hard to track down what is happening, especially when the customer is eager to blame me. At least, the idea is to detect a "worker strike" or a "manager riot" as early as possible. Any tips?
  4. Unfortunately the flicking still exists. I stopped the service and started the IDE.
  5. I removed "Smooth fonts" from RDP parameters. And it still blinks. For the sake of testing, I removed every option: And it still blinks.
  6. I disable most of new features IDE (one by one, and restarting the IDE after each change). Still blinks.
  7. I'll give you it's an old machine/graphic card... the same I used with 12.1, 11.x, 10.x ... where there was no blink.
  8. I can access my development machine in three ways. 1) Physically. I have access to the actual machine. 2) Remotely using VPN and RDP. 3) In the office, I use a physical machine with 2 VMs. One of those VM I'm using to open a VPN/RDP to access my development machine. After migrating to 12.2 I noticed some blinking when accessing my machine using the VM (method 3): There was the blinking. Using method 2 : blinking with method 1 no blinking at all. What's happening ( when using method 2 and 3) : As I type my code, some syntax check takes place. The code editor light ups a few areas of the IDE. For example, Red exclamation dots on the margins, the squirrels lines below invalid code, the structure windows displays the errors. During all that action, the lines in the code editor flashes very fast. And as I type the code to "resolve" the errors, the code editor blinks. It didn't happened with 12.1. I tried a few settings to optimize my RDP connection, but the blinking is still there. The optimization helped reducing a little.
  9. I just accessed the machine without VM and the code editor doesn't blink. Is there any special new settings for RDP access?
  10. Yes. I've tried Remote Desktop using single monitor and dual monitor ( my usual setup ). I have not changed anything in my connectivity. I just upgraded from 12.1 to 12.2
  11. The tools I have right know didn't manage to capture correctly. I have to use my phone. https://www.dhs.com.br/downloads/IDE_12_2_Blink.mp4 Even with the phone, it quite don't show how annoying it is.. but every key blinks
  12. Hi, Just upgraded to 12.2, and the installation completed without any errors. All my components are installed, everything is fine. I opened my latest project, and the code editor blinks for every key I press. Seems to be relate to an automated syntax check. Every key I type triggers a syntax checker (that pop's the error in the "Structure" window) blinks the entire code editor. *very* annoying Hopefully there's a checkbox to disable this. Any one experienced this? Is there away to disable it?
  13. Hello, I'm using 8.69, I can't update right now, and Delphi 12.1. I wrote a TUrlHandle child class to handle download of binary files. In this case zrnbw file. I'm unable to figure out how to do it. I'm missing a lot of things. With this code, any client application that connects to my appServer hangs after sending the download request. How would be the right way to handle downloading of binary data? TIA procedure THandler_files_UpdateDownload.Execute; const NO_CACHE: String = 'Pragma: no-cache' + #13#10 + 'Expires: -1' + #13#10; begin inherited; var lBasename : String; var lZrnbwFile := ''; var lParams := TStringList.Create('"', '&', [soStrictDelimiter]); try lParams.DelimitedText := Client.Params; lBaseName := TNetEncoding.URL.Decode( lParams.Values['basename'] ); lZrnbwFile := TPath.Combine( glbServerConfig.DefaultUpdate, lBasename+'.zrnbw'); if FileExists(lZrnbwFile) then begin DocStream := TFileStream.Create( lZrnbwFile, fmOpenRead ); AnswerStream('','application/binary',NO_CACHE); //Client.DocStream.Free; end finally lParams.free; end; end;
  14. There are lot's of ways to "slow your application". That's why it's important to have some code sample. I will assume you're already using "beginUpdate / EndUpdate" and/or "DisableControls / EnableControls" as also "LockDrawing / UnLockDrawing". That said, the best way to handle large dataset is to avoid working with large datasets up to the last minute, specially if there's any kind of visual binding. This will slow things down: Be sure to handle you data visualization carefully. It should (almost always) be faster to order your records server side, you should construct your order clause and feed the user with the amount of data required for his/her operation. The same goes to filtering. If you know the table you are querying, you should construct your "where clause" carefully to be sure there's an index backing it up. Managing large amounts of data client side will impact considerably memory. For example, if you need to traverse your dataset backwards and forwards, as most TDBGrid ( and alike ) requires, you will use more memory than Forward Cursor Only. If you require to order your dataset with several "memory created index", you will use more memory. Memory client datasets will require more ( or less ) memory depending on the amount of features implemented. And if things get really complex, you can consider having a local database.
×