summaryrefslogtreecommitdiff
path: root/ev.html
diff options
context:
space:
mode:
authorroot <root>2007-11-29 12:21:05 +0000
committerroot <root>2007-11-29 12:21:05 +0000
commit8d0f4d263d9a5601bb7d419e7db00970e288cb7e (patch)
treef1eb4dde57119a2d01d733eb8d897414e7720a52 /ev.html
parente036fde31e607a47af3e63e9c23cef34d88a2582 (diff)
many fixes to event emulation
Diffstat (limited to 'ev.html')
-rw-r--r--ev.html29
1 files changed, 15 insertions, 14 deletions
diff --git a/ev.html b/ev.html
index 6c59bec..08d84d5 100644
--- a/ev.html
+++ b/ev.html
@@ -6,7 +6,7 @@
<meta name="description" content="Pod documentation for libev" />
<meta name="inputfile" content="&lt;standard input&gt;" />
<meta name="outputfile" content="&lt;standard output&gt;" />
- <meta name="created" content="Wed Nov 28 19:29:25 2007" />
+ <meta name="created" content="Thu Nov 29 13:21:20 2007" />
<meta name="generator" content="Pod::Xhtml 1.57" />
<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head>
<body>
@@ -954,20 +954,21 @@ timer will not fire more than once per event loop iteration.</p>
<dd>
<p>This will act as if the timer timed out and restart it again if it is
repeating. The exact semantics are:</p>
- <p>If the timer is started but nonrepeating, stop it.</p>
- <p>If the timer is repeating, either start it if necessary (with the repeat
-value), or reset the running timer to the repeat value.</p>
+ <p>If the timer is pending, its pending status is cleared.</p>
+ <p>If the timer is started but nonrepeating, stop it (as if it timed out).</p>
+ <p>If the timer is repeating, either start it if necessary (with the
+<code>repeat</code> value), or reset the running timer to the <code>repeat</code> value.</p>
<p>This sounds a bit complicated, but here is a useful and typical
-example: Imagine you have a tcp connection and you want a so-called
-idle timeout, that is, you want to be called when there have been,
-say, 60 seconds of inactivity on the socket. The easiest way to do
-this is to configure an <code>ev_timer</code> with <code>after</code>=<code>repeat</code>=<code>60</code> and calling
+example: Imagine you have a tcp connection and you want a so-called idle
+timeout, that is, you want to be called when there have been, say, 60
+seconds of inactivity on the socket. The easiest way to do this is to
+configure an <code>ev_timer</code> with a <code>repeat</code> value of <code>60</code> and then call
<code>ev_timer_again</code> each time you successfully read or write some data. If
you go into an idle state where you do not expect data to travel on the
-socket, you can stop the timer, and again will automatically restart it if
-need be.</p>
- <p>You can also ignore the <code>after</code> value and <code>ev_timer_start</code> altogether
-and only ever use the <code>repeat</code> value:</p>
+socket, you can <code>ev_timer_stop</code> the timer, and <code>ev_timer_again</code> will
+automatically restart it if need be.</p>
+ <p>That means you can ignore the <code>after</code> value and <code>ev_timer_start</code>
+altogether and only ever use the <code>repeat</code> value and <code>ev_timer_again</code>:</p>
<pre> ev_timer_init (timer, callback, 0., 5.);
ev_timer_again (loop, timer);
...
@@ -978,8 +979,8 @@ and only ever use the <code>repeat</code> value:</p>
ev_timer_again (loop, timer);
</pre>
- <p>This is more efficient then stopping/starting the timer eahc time you want
-to modify its timeout value.</p>
+ <p>This is more slightly efficient then stopping/starting the timer each time
+you want to modify its timeout value.</p>
</dd>
<dt>ev_tstamp repeat [read-write]</dt>
<dd>