Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by FPiette

  1. FPiette

    Ics Multithreading exceptions

    There are at least two important rules to write a multithread program which make use of ICS: 1) All ICS components must be created in the context of the thread. This is done for example in the start of thread's Execute method. 2) The thread must have a message pump also called message loop. There is one prebuilt in TWSocket. Have a look at OverbyteIcsThrdSrv1. pas (A unit in one of the ICS samples) and look at TClientThread.Execute. As Angus said, ICS is able to handle hundreds of connections in a single thread as far as ICS is concerned. Of course you may have heavy processing requiring a thread to not block the system. ICS is asynchronous, non-blocking and event-driven. It has all the required features to avoid multi-threading. And if you need multithreading, you should probably consider having tens or hundreds of ICS component in a single thread (For example, if you need 1000 component working simultaneously, use 5 threads each handling 200 components. Or if you have not that much simultaneous components, another design is to have a single thread for all ICS component and then a thread for each lengthy (computation or blocking operation) process. A good multithreading application is hard to write and hard to debug.
  2. I looked closer to you code. I don't see any message pump. The component cannot work. See multithreaded sample programs delivered with ICS. They all include a message pump (GetMessage/PeekMessage.DispatchMessage and so on).
  3. No sure it is the problem but an ICS component must be created in the context of the thread handling his events. And that thread must have a message pump.
  4. The hpp file is created by the compiler when you install the components. The source code is actually OverbyteIcsSspi.pas. This source code reference several windows SDK header files. Maybe you have a different Windows SDK? Also, look at the source code OverbyteIcsSspi.pas: it the file I have, the symbol SEC_E_INVALID_HANDLE is commented out.
  5. FPiette

    ICS DLL for Visual Studio

    Creating a DLL project and adding all ICS source code is not enough ! You have to export the function you want to have and since you use C#, no export function can have arguments or return value other than simple C data types. You also have to pay attention to strings and characters: in D2006, there where ASCII. Now they are Unicode (C# support unicode as well). Since you are using your old DLL, it is likely that you exactly know which functions are exported and which argument they have. You should reproduce than.
  6. Thanks for feedback. Could you please make the fixed project available for other users?
  7. Why not put a try/except in you OnDataAvailable event handler?
  8. I don't see in your log that the persistent connection fails. I only see that the server is not happy with the request ("401 Invalid client!"). If the request succeed you get a 200 response code, not a 401. You should first resolve that. Maybe a cookie is required or some specific header lines.
  9. In the trace you provide, I see all GET commands are using HTTP 1.0 which don not support persistent connections as far as I know. You should request version 1.1.
  10. Hello, As you are reading this message, you probably use ICS. Good! But have you taken time to register your ICS copy? ICS is freeware but to use it, you must register it. Registration is very simple: just mail a [real, paper] picture postcard to the author (me). You can find instructions in the readme8.txt file in ICS distribution. Thanks. PS: If you already sent your picture postcard, simply ignore this message. If you want to know if I received it, then you must tell me by email when you sent it, from which country and what the picture look like (I have several thousands postcards!).
  11. FPiette

    ICS registration

    @Bob4231, don't do that. I'm only interested in real picture postcard. If you really like ICS, maybe you'll take time to find a picture postcard in a nearby town. I think they are sold everywhere in the world. BTW: I already have more than 4000 postcards!
  12. Hello, I have an old and excellent code by Russell Libby dated back to 2003 which I updated in 2013 for current Delphi (XE5 at that time). The code is working well for all Delphi XE versions and also for Delphi 10. Starting from Delphi 10.1 up to current Delphi 10.3.1 Rio, the code is broken. It compile fine but stay blocked at runtime. The blocking occurs in the server code, when an asynchronous I/O against a named pipe that is supposed to be finished. (Line 2710 in Pipes.pas, call to GetOverlappedResult). I tried several hours to debug the code, comparing what happen with Delphi 10 (Working) and Delphi 10.3.1 (not working), without success. I suspect something with multithreading more than with asynchronous I/O. I'll be happy if someone has an idea or - even better - has a look at the source code (attached). To test the code, compile and run the server, then the client. On the client, click connect button, then click send button. You'll see data sent by the client into the server window if it works. If it doesn't work, no data displayed on the server Window and the process has to be killed by task manager. Regards, François Piette Embarcadero MVP PipesRussellLibby.zip
  13. Please be more specific about the error and where it occurs. You should run your program Under the debugger if the error is an exception.
  14. I think you are using a quite old ICS version because currently, all ICS as well as Midware files have their name prefixed by Overbyte. Be sure to install latest ICS first. And make sure old ICS is not available anymore (It can stay on disk but shall not be found using search path of any kind). You have to install ICS as explained in ICS documentation. Do not copy ICS files from ICS folder to Midware folder. Instead add to your Delphi global search path the source folder of ICS as well as the source\include. Only then you can build Midware. I'm not sure but you should probably also modify OverbyteIcsDefs.inc to make sure USE_SSL is not defined when building Midware which do not require SSL. I mean I'm not sure ICS distribution has USE_SSL symbol defined or not.
  15. FPiette

    Hang problem

    You should also monitor the session closed event. If your client stop reading data without disconnecting, the timeout can be very long. I suggest you simply abort (Not close) the connection for that client.
  16. FPiette

    ICS registration

    SSL is included in the standard ICS distribution completely free of charge as the whole ICS. The fee date back a long time, when there was a kind of sponsoring of ICS users needing SSL support. They had the product before it became free. As I said, now there is only a single ICS which include SSL support.
  17. You are right. I updated the zip file. Please download again and let me know if it works now. Thanks.
  18. FPiette

    Hang problem

    You can put data into the sendbuffer (That is call one of the send method). In OnDataSend event Handler, you set a flag to true and you reset it when you call send. Initialize the flag to true when the connection is established. Before calling one of the send methods, check the flag. The question is what will you do when the client doesn't receive fast enough ? Just throw away the data ? If you buffer it, then you'll have again a problem of too much data eating all available memory.
  19. See the announce message there: https://en.delphipraxis.net/topic/969-midware-new-update-available-for-latest-delphi-and-ics/
  20. Hello Midware fan, I have updated Midware for the latest Delphi 10.3.1 Rio compiler and for the latest ICS version. You can download from http://www.overbyte.eu/eng/products/midware You can find documentation at http://wiki.overbyte.eu/wiki/index.php/midware If you have any question, please start a new topic and be sure to add "[Midware]" in front of the title line. Have a nice day coding with Delphi
  21. FPiette

    Remote Desktop with ICS

    I understood that your first test which succeeded was using a set of computers and a given network and that the second test use a different network - a company network- and probably other computers. IMO, with the second test, you have something blocking in the network managed by the company. The routs between the two computers may be complex inside a company, with routers, bridges, WAN, firewall and more. I suggest you get a simple Ethernet switch and connect the two computers under test directly on that switch or directly connect the two computers at each end of a single cable (a cross cable if the Ethernet cards are not able to sense I/O). Then verify that the software works as expected. If this succeed, it means everything is OK with the two computers and the software. Be sure that the two computers have their IP address in the same range (Use IPConfig to check that). Then connect the two computers on the company network and test if the software still work. If it doesn't then something in the company network is blocking the traffic you want to create (This is frequent in a company network where security is a concern). If it doesn't work, ask the system administrator. Note that the problem is even more complex if the two computers are separated by a router. All those problems are NOT related to ICS. They are just normal behaviour of a LAN/WAN based on IP protocol family.
  22. FPiette


    Thanks for feedback;
  23. FPiette

    Remote Desktop with ICS

    Check the firewall rules on each local computer, and check the firewall in the company infrastructure. Ask the system administrator to open the port you are using and to allow the application and routing of the traffic.
  24. Delphi 7 is too old. Using the current version available from my website. The new - unpublished yet - version is for recent Delphi compiler. Or upgrade your Delphi to the latest version (Delphi 10.3.1 Rio) you'll have tremendous enhancements compared to Delphi 7.