I was implement new feature to socket core called Heartbeat.

Heartbeats are called by data transfers and during waiting for 
incomming datas. During each heartbeat is StopFlag tested too.

Rate of heartbeats during waiting for data can be defined by new 
property HeartbeatRate (in milliseconds). Default value is 0 - 
heartbeats are disabled at all!

So, defaultly function of code is same as before. But when you set 
HeartbeatRate to nonzero value, you enable heartbeat generation, and 
maximum heartbeat period is defined by HeartbeatRate value.

It is good for:

- StopFlag ca be periodically tested, even you just waiting for data. 
Without this is not a chance to test StopFlag during transfer from 
cutted server.

- You can use new event OnHeartbeat, what is called by each 
heartbeat. It can be useful in many situations. For example, if you 
set reasonable HeartbeatRate value and call 
application.processmessages within OnHeartbeat event, then you can 
use it as 'antifreeze' feature, if you calling long socket operation 
by main GUI thread.

Of course, enabled heartbeats have negative impact to socket 
operation performance. But heartbeats are disabled by default.

Check next Synasnap for this new code.


-- 
Lukas Gebauer.

E-mail: [EMAIL PROTECTED]
http://synapse.ararat.cz/ - Ararat Synapse - TCP/IP Lib.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to