mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-08 16:14:38 +07:00
Minor update to README
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -3,7 +3,8 @@ libuev | Micro event loop library
|
||||
|
||||
Libuev is a small event library in the style of libevent, the excellent
|
||||
libev and the venerable Xt(3) event loop. The primary target is modern
|
||||
embedded Linux systems.
|
||||
embedded Linux systems. For power users, libuev is mainly a convenience
|
||||
wrapper for epoll, timerfd and signalfd.
|
||||
|
||||
|
||||
Usage
|
||||
@@ -19,12 +20,17 @@ loop that will only return at program termination.
|
||||
3. Enter the event loop with `uev_run()`
|
||||
4. Exit the event loop with `uev_exit()`, possibly from a callback
|
||||
|
||||
**Note:** Make sure to use non-blocking stream I/O!
|
||||
**Note:** Make sure to use non-blocking stream I/O! Most hard to find
|
||||
bugs in event driven applications is due to file descriptors and
|
||||
sockets being opened in blocking mode. Be careful out there!
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
Here is a very brief example to illustrate how one can use libuev. But
|
||||
please, pay more attention to return values than the author did below.
|
||||
|
||||
#include "uev.h"
|
||||
|
||||
static void signal_cb(uev_ctx_t *ctx, uev_t *w, void *UNUSED(arg), int UNUSED(events))
|
||||
@@ -57,6 +63,9 @@ Example
|
||||
return uev_run(&ctx);
|
||||
}
|
||||
|
||||
For a more complete, and perhaps more relevant example, see the code for
|
||||
the TFTP/FTP server [uftpd](https://github.com/troglobit/uftpd).
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user