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

A question of libevent example code: how is invoked?

I'm learning libev however the code is so hard to understand, so I choose to learn libevent first whose code is relatively clearer. But I encounter a problem when try the example (http://www.wangafu.net/~nickm/libevent-book/01_intro.html). How is…
user876269
  • 31
  • 1
  • 4
2
votes
1 answer

The implementaiton of event loop with Libuv or Libevent on v8, why is it necessary?

A Javascript web application has an event loop to handle the call stack and it loops around to check for any task queues returned by the browser's web API to run when the call stack is free. I will use v8 as the example for the javascript…
cozycoder
  • 309
  • 3
  • 9
2
votes
1 answer

What is most efficient approach processing data read from socket?

I would like to use libev for a streaming server I am writing. This is how everything is supposed to work: client opens a TCP socket connection to server server receives connection client sends a list of images they would like server reads…
Jacko
  • 12,665
  • 18
  • 75
  • 126
2
votes
2 answers

Creating Qt-based gui for a libevent app

I currently use libevent heavily for C/C++ network programming and I love how easily I can make an event-based app without having to worry if I need to use select,poll,epoll,kqueues etc. The apps I've made are text-only, and now I'm looking at…
2
votes
1 answer

libevent blocks when posting multipart file upload

I am working on an embedded arm board in C with linux kernel 4.14. I am using libevent version 2 and have created handlers for two URLs. One is for posting files and the other for getting the status of the upload. A user will be connected via…
Alex
  • 619
  • 1
  • 8
  • 25
2
votes
2 answers

Libevent HTTP Server & compression?

I'm using libevent2 in my application to host a http server. I cant find a built-in way to compress the output. These are the options I'm considering: Apply gzip/deflate compression using zlib in my app before sending out the response Hack…
tejas
  • 607
  • 6
  • 11
2
votes
0 answers

cmake on mac fails to find /usr/local/include (libevhtp)

I am trying to compile libevhtp (https://github.com/criticalstack/libevhtp) on my mac (10.13.3), but the cmake process does not seem to consider /usr/local/include (and thus wont find the required libevent headers): 16:43:42…
user826955
  • 3,137
  • 2
  • 30
  • 71
2
votes
1 answer

centos ./configure error: libevent not found despite it is installed via yum

I have a really strange problem. I am trying to compile a source (telegram-cli) which has dependency on openssl, libevent and other libraries. The system is centos 6.9 and "Development Tools" and libevent-devel and openssl-devel are installed via…
erfannf2
  • 85
  • 1
  • 8
2
votes
1 answer

How to install PGBouncer 1.7.2 on Solaris 10

I am attempting to upgrade my PGbouncer from 1.5.4 to 1.7.2 but no luck. It's returning error: # gmake CC lib/usual/tls/tls.c lib/usual/tls/tls.c: In function `tls_info_callback': lib/usual/tls/tls.c:295: error: structure has no member…
Joven D.
  • 21
  • 2
2
votes
1 answer

Reusing the same socket connection for multiple requests

This question may be slightly off topic but I didn't know where else to ask. I was reading this https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md and saw that the specification included being able to send out of order messages using…
Curious
  • 20,870
  • 8
  • 61
  • 146
2
votes
0 answers

How to make libwebsockets use kqueue() system call internally instead of _poll()?

SO FAR: 1- I have a native application that uses libwebsocket server to communicate to a browser(websockets client). 2- I see a HIGH CPU usage(activity monitor indicates 100% usage in a 4 core mac machine- Yosemite(10.10.4)) when the app is…
2
votes
3 answers

libevent2 and file io

I've been toying around with libevent2, and I've got reading files working, but it blocks. Is there any way to make file reading not block just within libevent. Or, do I need to use another IO library for files and make it pump events that I…
MathGladiator
  • 1,201
  • 1
  • 10
  • 24
2
votes
1 answer

How to detect a client gets connected to the server using Libevent

I am writing program that sets up a localhost server and a localhost client using libevent. And I need to know when the client gets connected to the server. Libevent provides six event signals for event callback, which are BEV_EVENT_READING,…
Jes
  • 2,614
  • 4
  • 25
  • 45
2
votes
1 answer

how the difference between libevent version 1.4 and 2.0 influence libpcap events?

I'm using libpcap and libevent in a program. the related source codes are: const u_int16_t RELAY_PORT = 8000; pcap_t *create_pcap(const void *dev, pcap_style_t style) { pcap_t *handle; /* Session handle */ struct bpf_program…
lily
  • 515
  • 7
  • 20
2
votes
1 answer

How libevent triggers callback

I am wondering how libevent triggers the callback. For example, let's say a client repeatedly sends a 4-byte message. In server's side, it seems not each 4-byte send will trigger a read callback. For example, I found the callback is sometimes…
Jes
  • 2,614
  • 4
  • 25
  • 45