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
3
votes
0 answers

What is the difference between any other event and an edge triggered event in libevent?

what is edge triggered event in libevent? What is the difference between any other event and an edge triggered event in libevent?
user2968375
  • 151
  • 1
  • 3
3
votes
1 answer

Does anyone used rpc framework inside libevent?

I have a multiserver multiclient application and I would like to keep some common data managed by a single daemon (to avoid a nightmare f concurrency), so the servers can just ask it when they need to manipulate the shared data. I am already using…
Alar
  • 760
  • 4
  • 11
3
votes
1 answer

libevent2 http server how to detect client close

I write a simple web server that handles long-polling, which means the server doesn't send a full HTTP response to the client(web browser, curl, etc), but only sends HTTP headers and hang the connection. I use command line curl to product a request…
ideawu
  • 2,287
  • 1
  • 23
  • 28
3
votes
1 answer

in what conditions getpeername returns IP:PORT 0.0.0.0:0

in my program I register a EV_READ event for connfd in libevent event loop. when this event is triggered, I use getpeername to get the IP/PORT address of the peer socklen_t socklen; struct sockaddr_in client_addr; socklen =…
user1944267
  • 1,557
  • 5
  • 20
  • 27
3
votes
2 answers

Reason and solution for error -"/usr/bin/ld: cannot find -levent "?

While compiling my program which is using libevent library I am using gcc option -levent. But I am getting this error - /usr/bin/ld: cannot find -levent I do not have libevent on my system so I am statically linking to it while compiling using gcc…
AJ.
  • 2,561
  • 9
  • 46
  • 81
3
votes
1 answer

libevent http client with request timeout

I am using libevent to get some stats of a web site in certain time intervals. I've based the program on this. The only thing I'm missing is a timeout on the request, preferably in subsecond accuracy. I've tried a few things, but couldn't get it to…
gkres
  • 668
  • 1
  • 8
  • 17
3
votes
1 answer

Python http proxy library based on libevent or comparable technology?

I'm looking to build an intelligent reverse http proxy capable of routing, header examination and enrichment (eg. examine and build cookies and http headers), and various other fanciness. For a general idea of what I'm looking to build see Ruby…
Parand
  • 102,950
  • 48
  • 151
  • 186
3
votes
2 answers

what's the difference between pending and active event in Libevent?

I'm learning how to use Libevent.While I can't understand the difference between pending and active.In my opinion,when a event is added to a event_base and the event hasn't happened, then it's in pending state,while the event which is waited by the…
rpbear
  • 640
  • 7
  • 15
3
votes
1 answer

How to ask libcurl not to listen on a socket just send a url request over it?

I have a client that manages the socket connection on its own (actually using libevent's bufferevent). Now, I'd like to use libcurl to produce and send HTML GET requests on that socket. I'm done with this part by feeding libcurl, my already opened…
vmon
  • 33
  • 3
2
votes
1 answer

Dont wait for server to respond using ZeroMQ

Today I had a look at what Rasmus described here http://toys.lerdorf.com/archives/57-ZeroMQ-+-libevent-in-PHP.html using ZeroMQ together with libevent in PHP. I got it to work, but I noticed that the client waits for the server to return/sending a…
Max
  • 15,693
  • 14
  • 81
  • 131
2
votes
1 answer

Server - Synchronous I/O Multiplexing (Sockets)

I have implemented a chat server in C/Linux that uses TCP sockets. It is currently using a single process and uses select() to keep the server from blocking. I've read that select() is a pretty slow method and I'm looking to upgrade the server to a…
Josh Brittain
  • 2,162
  • 7
  • 31
  • 54
2
votes
1 answer

build libevent under windows with cygwin?

I build libevent-2.0.16-stable under cygwin-windows with multi-thread feature support but it's seem that configure didn't detect environment as WIN32, so it did not include evthread_win32.c as a part of build process, a try call to…
secmask
  • 7,649
  • 5
  • 35
  • 52
2
votes
2 answers

Efficient preforked server design with NBIO like epoll, kqueue using libevent

I am planning on writing a 'comet' server for 'streaming' data to clients. I have enhanced one in the past to take advantage of the multi-core CPUs but now I'm starting from scratch. I am planning to use epoll/kqueue or libevent to power the…
void_ptr
  • 472
  • 3
  • 9
2
votes
1 answer

Libevent - Running the loop(event_base_loop)

Tell me please, here is a quote from reference section 3 ("Running an event loop") of Nick Mathewson's book on Libevent: By default, the event_base_loop() function runs an event_base until there are no more events registered in it. Honestly, I…
Optimus1
  • 444
  • 2
  • 13
2
votes
0 answers

Build Libevent with OpenSSL

Tell me please, i am trying to build Libevent for Windows using Cmake GUI, I select the libevent folder and click - configure. But, cmake reports an error: Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable…
Optimus1
  • 444
  • 2
  • 13