The TncClientSource will first try to connect, so you can ommit If you have forgotten to set Active to true and call ExecCommand, Processing requests from your server (a server can also While waiting for a command to return, your client socket may be The TncClientSource's OnHandleCommand still executes, so, ExecCommand is blocking (if aRequiresResult parameter is set to true), Pack the response, and return it as a result to your ExecCommand. This will send yourĬommand and data over to the server, call its OnHandleCommand, You call ExecCommand (on your TncClientSource), with anyĬommand number and data that you like. Your client is now connected to the server. You can set Host and Port to whatever you want. You put a TncClientSource on your form. For example, a ClientSource could be waiting on an ExecCommand to the server, but while waiting it can serve ExecCommand requests from the server! If you use the blocking behaviour, the component still handles incoming requests from its peer(s). ExecCommand can be blocking or non-blocking (async) depending on how you set its aRequiresResult parameter. Both of these components implement an ExecCommand (aCmd, aData) which triggers an OnHandleCommand event on the other side (a client can ExecCommand to a server, or a server can ExecCommand to any client). The set of components implementing this functionality is TncServerSource and TncClientSource. On top of the TCP/IP sockets, a lightweight protocol is implemented to be able to pack and unpack buffers (simple TCP/IP is streaming and has no notion of a well defined buffer). You can use TncTCPClient and TncTCPServer if all you want is to implement standard (but very fast) socket comms. The implementation begins with TncTCPServer and TncTCPClient which implements the basic socket communications. Threads are used per request and not per connection, and are maintained in a very fast thread pool class.
Forget using a thread per connection: With this suite you can have as many concurrent connections to your server as you like.
FREE PASCAL COMPILE DELPHI PROGRAM DSK CODE
This set of components is the fastest possible implementation of socket communications, in any language this is an extremely optimised code on TCP/IP sockets. You can compile your apps under all platforms in FireMonkey! In this version, the NetCom package is now multi-platform! This is version 7.2 of the NetCom package.