Jump to content

FPiette

Members
  • Content Count

    1121
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by FPiette

  1. I almost always use TFrame or TForm from each page of a TPageControl. And from elsewhere I don't reference the components they are made of. Instead, the frame or form expose properties, methods and events related to what is on the page. I strongly agree with you. Having huge main unit is how newbies are coding.
  2. That is wrong. Delphi 2009 introduced Unicode. This doesn't prevent compiling it with current Delphi version. You just have to replace in the source code "String" by "AnsiString". That's it ! Of course current Delphi still support ANSI strings (Data type is AnsiString and AnsiChar, String and Char are mapped to Unicode. Anyway, looking at Delphi Toolbox I see it has been maintained and support Delphi 10.3 which is the latest Delphi Community Editon. I don't understand that. Could you give a simple trivial example showing the problem?
  3. I made SSL part of ICS after reading the book "Network Security with OpenSSL". This is now an old book, but all the concepts and most of programming is still valid today.
  4. A certificate is used to make sure someone is really what he pretend to be. For example you want to make sure that when you connect to your bank, it is really your bank. You verify this by the certificate your bank send in the SSL session. That certificate is signed by a "certification authority" (Or a chain of such certification authorities) that you trust. A client can also use a certificate to prove he is the one he pretend to be. The server will check the certificate to see if it is one that he expect. Usually, client don't use certificate except for some VPN. Most banks don't care about your certificate, if any, because they use other authentication methods such as a physical digipass. No matter if a certificate is used or not, SSL (Or TLS) communication is stronglly crypted. Now that I have introduced the subject, I can answer: As a client you only need a certificate if the server requires a certificate.
  5. Bad idea IMO. That was a bad idea. Never do that for any component. Always use inheritance for that (Create you own component inheriting from the existing). If you can't do what you need in the inherited class, for example because a method is not virtual or private or similar, then contact author to request a small change. You should really get rid of the old Delphi 5, and anything else but the latest from Embarcadero. You have not answered my question about why you can't upgrade.
  6. In a set of projects, you have to handle differently the source for each of the individual projects and the source for libraries, components and other common files. I have a common base for everything, then a subdirectory for libraries, components and common files, then a sub-directory for all projects. The library sub-directory has one sub-directory for each group of sources (A library or component can be made of several sources). The project sub-directory has one sub-directory for each project. In the sub-directory for each project, I have different directories: for sources, for docs, for dcus, for binaries, for images,... I never use search path in projects: I always add each required unit in the project. This way I see what the project really need. When creating a project which is similar to an existing one, I first work on the existing one to split as much as possible the sources: some which are specific to that project and other sources which will be common. Then I move the new common files to the library directory in an appropriate sub-directory. Then I using the IDE save the project file to the directory where the new project will live and then, using the IDE, I save all specific files to the same directory. This must be done in that order so that the original project stay untouched. I tend to have many source files of small size. Each file contain only things that are needed for the file main purpose.
  7. Not sure about the cause because you did not told us which exact error message you have. Maybe you forgot to install ICS component package. Or you did but you opened the project BEFORE having installed ICS and when the IDE complain about missing component you answered "ignore". You shoulg have answered "cancel" because "ignore" will remove the missing component and open the form. It will still run if you install the old OpenSSL version of that time. But it is likely that webserver you'll try to connect to will refuse the connection because it sees an outdated SSL version.
  8. FPiette

    ICS crash

    Yes, there is so that the use of TWSocket is the same for both TCP and TCP. Look at the source code if you are interested.
  9. Definitely not ! Use UIntPtr (Alias to NativeUInt) which is a type especially created for that purpose.
  10. FPiette

    ICS crash

    Don't do that. Use OnSessionConnected event and write a handler which checks if connection is successful and if it is, can SendLine to send something.
  11. As far as I remember, the very old ICS which still support Delphi 5 lacks SSL although I'm not sure. Why can't you upgrade to latest Delphi version? If it is for hobby or small business, you can use the Community Edition which is free. Unless you use old components for which you don't have the source, it is not that difficult to port Delphi 5 to latest Delphi version.
  12. I'm sure everyone will love to have a styled VirtualTree!
  13. Wouldn't be interesting to update VirtualTrees source code at https://github.com/JAM-Software/Virtual-TreeView ?
  14. This article is about random insertion and random deletion, I guess they take into account the time required to locate the record in the list. If random means generating a random index number, then it is the worst case possible for linked list and best case for array (direct access). If that is a main access pattern, then a linked list is NOT the correct data structure. Insertion/deletion in a linked list is only quick provided the insertion/deletion point is already available. Measuring the performance for a search separately from performance for insert/delete itself is what has to be done to truly compare linked-list and arrays or any other data structure such as a dictionary or hash table. A linked list is excellent for a FIFO QUEUE or LIFO QUEUE (STACK). And that is the problem in the case of this message thread: communication which require a FIFO queue between receiving process and computing process. That is why I proposed a linked-list.
  15. Installed. Up to now source indexer works as expected. Thanks. btw: I almost use only the source indexer.
  16. Source indexer doesn't work here (not shown when asked). Never noticed it is when debug layout is active. I have a basic setup with MMX being the only add-on.
  17. Linked lists compared to arrays allow to insert/delete/move items without moving the whole array. When doing a FIFO, it is very important to be able to quickly insert at one end. With linked list it is easy to implement multiple queues, for example a free list and a busy list without moving data. Obviously, if you have a small numbers of items, it makes no differences. For a really small number of items, a linked list may even be slower that an array. As everywhere, use case are different and there is no best solution for everything. That's true for anything! Non optimized is... non optimized 🙂
  18. Yes. The remote site will experience and abort error if a transfer is occurring.
  19. You should not destroy the component from an event handler of that component (general rule, not specific of ICS) or you'll experience access violation or other strange behavior. From an event handler, you can defer the destroy using a PostMessage of a custom message. That is what TForm.Release does by the way.
  20. FPiette

    gtPDFEngine

    Do you have gtClasse3.pas or gtClasse3.dcu somewhere in Delphi search path or project search path, or directly added in your project? Any typo error?
  21. No, only TCP. UDP is a datagram oriented protocol. But you are able to discover which protocol is used in your processor stuff. What I say is that you have to move the part of the code out of the processor code and move it to an intermediate layer between the low level receiver and high level the processor. Layers is the key success in protocol handling. RawByteString is low performance. It is all about memory alloc/free, data copy and memory fragmentation. Low performance but easier to design and develop. Linked list (Or queue if you want to encapsulate the linked list in another name) is the way to go for performance as I explained. And yes, I agree that this is more complex to design and develop but this is the price to pay for performance. I bet you will never do that change. You'll buy a higher performance computer.
  22. Not tricky but less trivial. As someone else said in this conversation, performance often means more complex solution. You put your priority where you want! Maybe you don't know, but I'm the author of ICS (Internet Component Suite) and what you describe is exactly what happens with a TCP stream which is what a TCP socket gives. So I have large experience in that kind of data receiving handling. There are 3 ways to delimit data: 1) There are delimiters such STX/END around a data block or a CRLF (or any other end-of-block marker) at the end of data block. 2) Each block begins with a data length. 3) Communication is closed or broken You should move the determination of the data block complete/incomplete in the receiving process or thread, not in the processing thread. This means that the same buffer (Pointer and length or pointer to star, offset and length) is given to the low level receiver until a complete data block is received. Only then this data block is put at the end of the incoming data linked list (or Queue if you prefer this term) for processing.
×