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

error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file:

I'm using libevent for a program, I compile my program on two computers A and B, on A the execution is successful, but on B I got the following errors: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such…
misteryes
  • 2,167
  • 4
  • 32
  • 58
8
votes
1 answer

libevent error when installing tmux_1.8 on Ubuntu 12.04

I want to install tmux 1.8 on my ubuntu 12.04 after tar zxvf tmux-1.8.tar.gz cd tmux_1.8 ./configure but here is some error infomation, ... checking pkg-config is at least version 0.9.0... yes checking for LIBEVENT... no checking for library…
mingchaoyan
  • 8,096
  • 3
  • 23
  • 31
8
votes
1 answer

libevent, windows and .NET programming

I experiment with a lot of open source software and I've noticed a fair amount of server type applications in the open source world use libevent to facilitate event-based processing rather than spawn multiple threads to handle requests. I also do a…
Chris
  • 27,596
  • 25
  • 124
  • 225
7
votes
2 answers

Using libcurl with libevent

Can anyone show (through code) or explain to me how I might use libevent and curl together in a c program? I'm trying to write a high-performance non-blocking data monitor which needs to upload data to a CouchDB instance. I'm familiar with both…
Peter Downs
  • 482
  • 1
  • 4
  • 14
7
votes
1 answer

libevent and non-blocking sockets

I understand that in order to monitor a socket using libevent, event_set() should first be called with the correct parameters. The libevent documentation states that the event parameter to event_set() can be either EV_READ or EV_WRITE. And that…
BeeBand
  • 10,953
  • 19
  • 61
  • 83
7
votes
1 answer

How to install right version of libevent on OSX?

I want to run Telegram CLI on my Macbook with latest version of OSX. It worked sometime before, but doesn't work now: dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.0.5.dylib Referenced from: /Users/me/tg/bin/./telegram-cli …
LA_
  • 19,823
  • 58
  • 172
  • 308
6
votes
1 answer

Cannot link LIBEVENT as C++

Why this does not work, file test.c: #include int main(void) { event_init(); return 0; } Then: gcc -o test.o -c test.c runs OK, but Link: g++ -o test -levent test.o produces test.o: In function `main': test.c:(.text+0x5):…
Cartesius00
  • 23,584
  • 43
  • 124
  • 195
6
votes
1 answer

Multi-process php with libevent

I am able to make a simple php websocket server with libevent , but I am stuck when I'm trying to make it multiprocessing. for example this is single processing
Deadworldisee
  • 61
  • 1
  • 2
6
votes
1 answer

Using libevent together with GCD (libdispatch) in Swift

I'm creating a server side app in Swift 3. I've chosen libevent for implementing networking code because it's cross-platform and doesn't suffer from C10k problem. Libevent implements it's own event loop, but I want to keep CFRunLoop and GCD…
Zmey
  • 2,304
  • 1
  • 24
  • 40
6
votes
4 answers

Is there a Java equivalent to libevent?

I've written a high-throughput server that handles each request in its own thread. For requests coming in it is occasionally necessary to do RPCs to one or more back-ends. These back-end RPCs are handled by a separate queue and thread-pool, which…
JoelPM
  • 1,752
  • 2
  • 11
  • 7
6
votes
3 answers

Cross Compiling libevent for Android

I'm stuck trying to cross-compile libevent to Android and I'd like to know what I'm doing wrong and get some assistance. The version I'm trying to build is libevent-2.0.19-stable I started following the steps described at…
Narseo
  • 214
  • 1
  • 4
  • 11
5
votes
3 answers

Problem handling file I/O with libevent2

I worked with libevent2 for some time, but usually I used it to handle network I/O (using sockets). Now I need to read many different files so I also wanted to use it. I created this code: int file = open(filename, O_RDONLY); struct event…
harnen
  • 403
  • 4
  • 12
5
votes
3 answers

How to compile memcached on Windows?

I am trying to get memcached running on Windows. I have downloaded memcached stable latest and compiled it using Mingw under Windows 7. Configure failed with error, checking for libevent directory... configure: error: libevent is required. You…
Navaneeth K N
  • 15,295
  • 38
  • 126
  • 184
4
votes
1 answer

Async Redis pooling using libevent

I want get as much as possible from Redis + Hiredis + libevent. I'm using following code (without any checks to be short) #include #include #include #include #include…
Sebastian Sito
  • 163
  • 3
  • 10
4
votes
2 answers

Libevent Multithread Support

i have a few questions regarding libevent2 and its multithread support. Does libevent support multiple Threads? What i would like to achieve is something like this: Create an event_base in a single thread. In this single Thread setup events and…
user109343
  • 43
  • 1
  • 1
  • 5
1
2
3
24 25