Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are a few really easy ways to do this with Delphi, although I am sure the RemObjects SDK works really well too.</p> <ol> <li>Have a central server that has a * TIdTCPServer listening* on it. Then each client has a <em>TIdTCPClient</em> on it. They connect to the server and <strong>block on a read</strong> <em>waiting</em> for the <strong>server to write</strong>. Once the server receives a notification via a listening socket it <em>broadcasts</em> to each of the waiting clients. This is pretty much immediate notification of all the clients. </li> <li>Have a central server that has a <strong>TIdTCPServer listenin</strong>g on it. Then each client has a <strong>TIdTCPClient</strong> on it. Those clients can <em>"ping"</em> the server to ask for updates at a regular interval (use a session token to maintain state). The frequency of the interval determines how quick the notification will be. When once one of the clients needs to notify the others, it just notifies the server. The server then uses a <em>message queue</em> to make a list of all active client sessions and adds a notification for each. Then the next time each of the clients connects it gives it the notification and remove it from the queue.</li> <li>Maintain a <em>session table</em> in the database where each client updates regularly that they have an active session, and removes itself when it disconnects. You will need a maintenance process that removes dead sessions. Then you have a <em>message queue table</em> that a client can write an update to with one row for each current active session. Then the other clients can regularly ping that table to see if there are any pending notifications for its session, if there are it can read them, act on them and then remove them.</li> <li>Some sort of <em>peer to peer</em> approach were the clients are aware of each other through information in the database and then they connect directly to each other and notify or ask for notifications (depending on firewall and NAT configurations). A little more complex, but possible.</li> </ol> <p>Obviously the choice of implementation will depend on your setup and needs. Tunning will be necessary to achieve the best results. </p> <p>The components you need for this are the <strong>TIdTCPServer</strong> (listener) and <strong>TIdTCPClient</strong> (sender). Both of which are in the Indy libraries in Delphi.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload