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
4
votes
1 answer

Limit connections in libevent

I want to control limit of possible libevent-http connections per process. How can i do that ? I didn't found any info in documentation, please help! I think that if i didn't limit number of connections - system can crash. Project is very high…
artyomboyko
  • 2,781
  • 5
  • 40
  • 54
4
votes
2 answers

Best approach for Comet? (Non Blocking IO vs Erlang)

Perhaps the Question isnt that simple to answer... but what is your opinion? Should i either use Non-Blocking approaches (libevent for exampe) or use erlang light weight processes to: Achieve as much connections as possible at a given amount of…
Filipe Santos
  • 1,629
  • 3
  • 18
  • 27
4
votes
3 answers

If i want event driven server what to use libevent or libev?

i want to make basic chat server using one of the event driven libarary . but what to chose ? libevent or libev what is better ? which has better c++ support ? which runes better in windows ? what is faster ? faster to develop and understand
user63898
  • 29,839
  • 85
  • 272
  • 514
4
votes
0 answers

Multithreading in libevent

I have one thread (Thread A) in a C static library that's creating the libevent event_base after doing this: #ifdef WIN32 evthread_use_windows_threads(); #else evthread_use_pthreads(); #endif This C static library is all single threaded and…
theodor96
  • 41
  • 8
4
votes
1 answer

Difference between signals and slots in Qt and LibEvent

Maybe it's a very strange question for someone, but what is the difference between signals and slots system in Qt and LibEvent library? Because it seems that they both used for something similar. Why I need to use LibEvent if I already have signals…
konstantin_doncov
  • 2,725
  • 4
  • 40
  • 100
4
votes
1 answer

How to check installed libevent version?

I have two different versions of libevent on my Centos 6, libevent version 1.4 (system default) in /usr/lib and version 2.0.21 (built from scratch) in /usr/local/lib (I have come to this conclusion because of these files libevent-1.4.so.2 and…
andi99
  • 117
  • 3
  • 8
4
votes
1 answer

Knowing all callbacks have run with libevent and bufferevent_free

I'm doing some work with libevent, version 2.0.22, and I'm struggling with dealing with bufferevent_free and making sure sockets close at the right time. This is within an iOS app built with Xcode 6.4, running on iOS 8.4. Each socket is managed by a…
dpassage
  • 5,423
  • 3
  • 25
  • 53
4
votes
3 answers

Break event_base_dispatch from another thread

Can I call event_base_loopbreak to int event_base_dispatch(struct event_base *base) that run in another thread?
user3315755
  • 53
  • 2
  • 5
4
votes
2 answers

get all the HTTP headers from HTTP server response in libevent

Using libevent to do HTTP request. I would like to print all the HTTP headers in the server response, but not sure how. static void http_request_done(struct evhttp_request *req, void *ctx) { //how do I print out all the http headers in the…
packetie
  • 4,839
  • 8
  • 37
  • 72
4
votes
3 answers

undefined reference to `event_new' when compiling with libevent

I am using libevent now: #include #include #include #include #include #include struct event_base *base; int PORT = 9999; int BACKLOG = 5; int create_bind_listen() { …
kaitian521
  • 548
  • 2
  • 10
  • 25
4
votes
1 answer

High-performance server using libEvent

I'm designing a high-performance server (not an HTTP server) and am considering my design options. The server should support a large number of incoming connections (in thousands), and to compile on both windows and linux. On the windows side, I've…
Nitay
  • 4,193
  • 6
  • 33
  • 42
4
votes
1 answer

libevent: why does it depend on openssl?

About to compile libevent from sources, I just noticed that it seems to have a dependency on OpenSSL for encryption o_O. This sounds like bloat. What does a library that provides OS-independent asynchronous IO abstractions need encryption for? How…
Cetin Sert
  • 4,497
  • 5
  • 38
  • 76
4
votes
5 answers

libevent: make timer persistent

I have the following code: #include #include #include void say_hello(int fd, short event, void *arg){ printf("Hello\n"); } int main(int argc, const char* argv[]) { struct event ev; struct timeval tv; …
Eamorr
  • 9,872
  • 34
  • 125
  • 209
4
votes
3 answers

How to read evbuffer and put it into a string (char*) in libevent

I am using libevent and its http API to write a simple HTTP server capable of writing C servlets. This servlet is working ok with GET but now I am sending some data with POST and I would like to read the incoming event buffer evb. I would like to…
rtacconi
  • 14,317
  • 20
  • 66
  • 84
3
votes
1 answer

C or C++ with libevent/libev: monitor a unix socket

I'm trying to monitor a unix socket ("/tmp/mysocket"). I can do this fine in Node.js: it raises an event when a socket is bound someone connects to the socket data is sent to the socket and the socket is disconnected. I'm trying to now do this in…
Eamorr
  • 9,872
  • 34
  • 125
  • 209
1 2
3
24 25