Questions tagged [libevent]

libevent is an API for writing event driven systems. libevent is written in C and should compile on Linux, *BSD, Mac OS X, Solaris and Windows.

From the Homepage: Libevent

libevent is meant to replace the event loop found in event driven network servers. An application just needs to call event_dispatch() and then add or remove events dynamically without having to change the event loop.

Currently, libevent supports /dev/poll, kqueue(2), event ports, select(2), poll(2) and epoll(4). The internal event mechanism is completely independent of the exposed event API, and a simple update of libevent can provide new functionality without having to redesign the applications. As a result, Libevent allows for portable application development and provides the most scalable event notification mechanism available on an operating system. Libevent can also be used for multi-threaded applications; see Steven Grimm's explanation. Libevent should compile on Linux, *BSD, Mac OS X, Solaris and Windows.

368 questions
2
votes
0 answers

Can I limit the memory usage of bufferevents in libevent?

Does libevent have a way to restrict the memory usage or the outstanding unwritten data with the bufferevents API? Alternatively, what happens when libevent runs out of memory? My application reads data from a file, parses it, and sends it over the…
Alex Reece
  • 1,906
  • 22
  • 31
2
votes
1 answer

How does event_base_dispatch( ) work?

What happens internally when event_base_dispatch( ) function is called? Are there any threads that are created which keep running until some signal to stop is received?
xennygrimmato
  • 2,646
  • 7
  • 25
  • 47
2
votes
1 answer

Monitoring a couchbase bucket with libevent

I'm trying to implement a C application that will monitor writes / modifications / new documents events happening on a couchbase remote cluster coming from a different application. I am now familiar with couchbase C SDK and synchronous instances but…
Starscream
  • 1,128
  • 1
  • 9
  • 22
2
votes
0 answers

Are there any simple libev/libevent implementations supporting websockets?

I am looking for an echo server example using libev or libevent that accepts websocket connections: a websocket client connects, sends a message and receives it back. SSL websockets should also be supported. Is there such thing available? If not,…
Alec Matusis
  • 781
  • 1
  • 7
  • 16
2
votes
1 answer

Installation of memcached - unable to find libevent

To install memcached I run: ./configure from memcached server location but I receive error: checking for libevent directory... configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/ If it's…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
2
votes
3 answers

How do you install Libevent for PHP?

I installed the libevent-dev library on my Debian 7 64bit desktop: $ sudo aptitude install -y libevent-dev Then I installed the PECL library $ pecl list Installed packages, channel pecl.php.net: ========================================= Package …
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
2
votes
0 answers

Best way to send data using LibEvent

I have a multi-threaded C++ app using lib event. The receive all happens in the libevent process and then a flag is set so that the data received is processed later. On the send tho, things go wrong. I am in a "main thread" and the data to send is…
Mickey Kawick
  • 187
  • 1
  • 12
2
votes
1 answer

Libevent: how to close all open sockets on shutdown?

I have created a simple HTTP proxy using libevent. It can be shutdown by sending it a SIGHUP signal which is caught by the signal handler. The shutdown function calls event_base_loopexit, frees structures and other heap allocations and…
SlappyTheFish
  • 2,344
  • 3
  • 34
  • 41
2
votes
1 answer

Libevent code not connecting or timing out on OSX Mountain Lion

Edit: Here is the tcpdump output when running the program on OSX: Matthew-Mitchell:calm-ocean-4924 matt$ sudo tcpdump -X -i lo0 'port 45564' Password: tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on lo0,…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
2
votes
1 answer

Rs232 using libevent

I am trying to use libevent for manage the serial communication between an embedded Linux device and a pc. First problem with libevent. I've created a C Project in eclipse , in the main I am creating some events and it is ok for the…
Cristina
  • 159
  • 3
  • 16
2
votes
1 answer

libevent on mac, make install

I follow the README to install the libevent on Mac os In the last step, make install, It shows Making install in include make[3]: Nothing to be done for `install-exec-am'. .././install-sh -c -d '/usr/local/include' .././install-sh -c -d…
alexis
  • 569
  • 5
  • 12
2
votes
1 answer

Do I have to protect bufferevent_write with mutex in a multithreaded server

libevent claims to be thread-safe, but I'm wondering if that means we don't need to run bufferevent_write protected by mutexes. I'd like to run the function bufferevent_write of libevent in several different threads and they can be executed at the…
JMBise
  • 680
  • 4
  • 19
2
votes
1 answer

Handling HTTP and HTTPS requests with libevent in a same socket

Drawing on https://github.com/ppelleti/https-example, I've tried to define the following code in order to handle (server side) https and http requests. Is there a more simple way to handle https AND http requests in a single listening socket? Thanks…
jackb
  • 695
  • 8
  • 26
2
votes
1 answer

libevent: timeout event is not triggered

I'm writing a program and use libevent. I add an event struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 10000; ... ... event_set(&ev, fd, EV_READ|EV_TIMEOUT|EV_PERSIST, callback, NULL); event_add(&ev, &tv); but I notice that if I replace &tv with…
misteryes
  • 2,167
  • 4
  • 32
  • 58
2
votes
1 answer

How to statically link libevent with gcc while compiling?

I have used event.h in on of my project but the server it has to run on does not support it. Moreover I can not install it also. Is there a way I can run my project with minimum modifications. It has to be compiled statically linked in but how do I…
AJ.
  • 2,561
  • 9
  • 46
  • 81