NetTalk Central

Author Topic: Keeping a permanent connection between Client and Server  (Read 3113 times)

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Keeping a permanent connection between Client and Server
« on: May 03, 2011, 01:44:50 AM »
Hi all,

usually the connection between a Client and a Server remains only as long as the data have been transferred successfully, often less than a fraction of a second.

What I tried now is to keep the connection up permanently. I did so by setting the TimeOut rather high, to 124 seconds. In the Clients timer I send a sort of heartbeat every 61 seconds, sending something like "I am still here" to the Server. The Server now responds with something like "Thanks for staying online" back to that specific Client.

The Server keeps a queue with all connected Clients, their IP-Addresses and a timestamp of their last heartbeat.

What is the purpose? The Server listens to my phoneline and once a call comes in,  a message to all connected Clients is sent with the CallerID etc. All the Clients now popup and display the CallerID on all machines across the LAN. It works even across the internet, using a DynDNS-Address.

The question now: is this lege artis?

My idea is to do something similar with our product that may be run on CITRIX. As I learned from Bruce's response about my latest question, the instances the user have started on a TerminalServer can't be Server each, as they all run on the same machine. We first thought of giving them unique ports then, but we eventualy decided that this is not a good idea at all.

But as we need some sort of communication back and forth, if they can't be Server, they have to be Clients. But how to let them know that they got a message? In this case the message is for a specific client, not all for all as with my CallerID. But that keeping-up of a connection might be the solution.

Any reasons against this plan?

With obedient greetings,
sincerley yours,
Caspar Milquetoast

<g>

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Keeping a permanent connection between Client and Server
« Reply #1 on: May 03, 2011, 02:59:35 AM »
>> usually the connection between a Client and a Server remains only as long as the data have been transferred successfully, often less than a fraction of a second.

A _web server_ yes - but this isn't a general restriction. In TCP/IP protocols there is often some way to keep a connection open - FTP for example has the NOOP (NO OPeration) command.

>> The question now: is this lege artis?

sure.

>> Any reasons against this plan?

sounds fine to me.

cheers
Bruce