Giter VIP home page Giter VIP logo

libev's Introduction

libev is a high-performance event loop/event model with lots of features.
(see benchmark at http://libev.schmorp.de/bench.html)


ABOUT

   Homepage: http://software.schmorp.de/pkg/libev
   Mailinglist: [email protected]
                http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
   Library Documentation: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod

   Libev is modelled (very losely) after libevent and the Event perl
   module, but is faster, scales better and is more correct, and also more
   featureful. And also smaller. Yay.

   Some of the specialties of libev not commonly found elsewhere are:
   
   - extensive and detailed, readable documentation (not doxygen garbage).
   - fully supports fork, can detect fork in various ways and automatically
     re-arms kernel mechanisms that do not support fork.
   - highly optimised select, poll, linux epoll, linux aio, bsd kqueue
     and solaris event ports backends.
   - filesystem object (path) watching (with optional linux inotify support).
   - wallclock-based times (using absolute time, cron-like).
   - relative timers/timeouts (handle time jumps).
   - fast intra-thread communication between multiple
     event loops (with optional fast linux eventfd backend).
   - extremely easy to embed (fully documented, no dependencies,
     autoconf supported but optional).
   - very small codebase, no bloated library, simple code.
   - fully extensible by being able to plug into the event loop,
     integrate other event loops, integrate other event loop users.
   - very little memory use (small watchers, small event loop data).
   - optional C++ interface allowing method and function callbacks
     at no extra memory or runtime overhead.
   - optional Perl interface with similar characteristics (capable
     of running Glib/Gtk2 on libev).
   - support for other languages (multiple C++ interfaces, D, Ruby,
     Python) available from third-parties.

   Examples of programs that embed libev: the EV perl module, node.js,
   auditd, rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the
   Deliantra MMORPG server (http://www.deliantra.net/), Rubinius (a
   next-generation Ruby VM), the Ebb web server, the Rev event toolkit.


CONTRIBUTORS

   libev was written and designed by Marc Lehmann and Emanuele Giaquinta.

   The following people sent in patches or made other noteworthy
   contributions to the design (for minor patches, see the Changes
   file. If I forgot to include you, please shout at me, it was an
   accident):

   W.C.A. Wijngaards
   Christopher Layne
   Chris Brody

libev's People

Contributors

kindy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libev's Issues

libev have some bug?

i have write a code:

#include <stdio.h>
#include <unistd.h>
#include<arpa/inet.h>
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>

ev_io stdin_watcher;
ev_timer timeout_watcher;
static void timeout_cb (EV_P_ ev_timer *w, int revents) ;

static void udp_cb (EV_P_ ev_io *w, int revents)
{
        char buf[101] = {0};
        read(w->fd,buf,100);
        printf("read data---->%s\n",buf);
        ev_io_stop (EV_A_ w);
        ev_break (EV_A_ EVBREAK_ALL);
}

static int flag = 0;
struct ev_loop *loop;

static void timeout_cb (EV_P_ ev_timer *w, int revents)
{
        if(flag == 0){
                sleep(30);
                flag = 1;
        }
        ev_timer_stop (loop, w);
        ev_timer_set (w, 1, 0.0);
        ev_timer_start (loop, w);
        printf("2-----ev_now=%d,ev_time=%d\n",ev_now(EV_A),ev_time());
        printf("end\n");
}

int main (void)
{
        loop = EV_DEFAULT;
        int sock = socket(AF_INET,SOCK_DGRAM,0);
        if(sock<0){
                perror("socket");
                exit(1);
        }

        struct sockaddr_in local;
        local.sin_family = AF_INET;
        local.sin_port = htons(7777);
        local.sin_addr.s_addr = inet_addr("0.0.0.0");
        if(bind(sock,(struct sockaddr*)&local,sizeof(local))<0){
                perror("bind");
                exit(0);
        }

        ev_io_init (&stdin_watcher, udp_cb,sock, EV_READ);
        ev_io_start (loop, &stdin_watcher);

        ev_timer_init (&timeout_watcher, timeout_cb, 1,0.0);
        ev_timer_start(loop, &timeout_watcher);
        ev_run (loop, 0);

        return 0;
}

compile : gcc -o test 1.c -lev

test it and the result is : before the timeout happy and udp sock recived data in this period. this timeout_cb always trigger twice and quit. i cannot decide this is bug? Why it triggers twice instead of once?

can this project build on windows?

I want to build libev on windows,but got some trouble when I try to do this.can this project be done or do you have any good Suggestions? thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.