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

How to get application process to wait until the socket has data to read using libevent bufferevents?

I'm working with libevent for the first time and have been having an issue trying to get my application to not run until the read callback is called. I am using bufferevents as well. Essentially I am doing is trying to avoid the sleep in my main…
SSB
  • 349
  • 3
  • 18
0
votes
1 answer

Retrieve base from timer?

I'm testing libevent's timer functionality. I set the timer with the following, which fires the timer every 3 seconds: shared_ptr base(event_base_new(), std::ptr_fun(event_base_free)); vector > std_events; ... static…
jww
  • 97,681
  • 90
  • 411
  • 885
0
votes
1 answer

event_new() function fails on hpux itanium

I'm trying to debug a code that is using a libevent library. In that library, there is a function event_new that is suppose to create an event_cb. Somehow after I dispatch the event base, the event_cb cannot be called or accessed. This problem only…
Mohd Fikrie
  • 197
  • 4
  • 21
0
votes
1 answer

How are reboot handle when a process is still running

Here's the situation. I'm debugging a code to do a logging function. When the user log in, the log file will be create with .part format. This file is save locally inside the host. I do not know why it's name as .part. When the user finish their…
Mohd Fikrie
  • 197
  • 4
  • 21
0
votes
1 answer

How can do I link libevent that has been configured to have a different prefix?

I am trying to link libevent using g++ but am having trouble since I set libevent's install directory with the --prefix flag when configuring. To install libevent I downloaded the latest source, extracted it and ran the following commands in the…
tab1293
  • 35
  • 9
0
votes
1 answer

MAMP, installing PECL event

I want in install pecl event using pecl install event I have followed this so far, http://www.lullabot.com/blog/article/installing-php-pear-and-pecl-extensions-mamp-mac-os-x-107-lion, with limited success. I get the following error configure:…
Jake N
  • 10,535
  • 11
  • 66
  • 112
0
votes
0 answers

Sending data with libevent works just sometimes

While developing it's very common that things work or they don't. When sending data from my client to my server it does not work everytime but in most cases it does. I am guessing that probably the kernel don't send the buffer it has stored.…
andrew
  • 97
  • 1
  • 10
0
votes
1 answer

How to pass in a structure member to a function

I need to write a C code using libevent. This is briefly what I expect to do. From stdin, a character will go through in_read_cb. in_read_cb will sent to master_read_cb. master_read_cb will then send to the system to process. These 2 function are…
Mohd Fikrie
  • 197
  • 4
  • 21
0
votes
2 answers

write non-blocking event with with libevent in C programming

I am newbie in libevent and socket programming that's why I have question about how libevent working as asynchronous and non blocking. Here is the reference code. https://github.com/libevent/libevent/blob/master/sample/http-server.c static void…
Vikas
  • 43
  • 2
  • 11
0
votes
1 answer

Multi-threaded HTTP server with libevent

I'm trying to get a simple HTTP server done with libevent and managed to do it based on the documentation examples. However, without threads, the whole purpose of libevent is garbage. I'm not very experienced with threads in C++11, but i would love…
vinnylinux
  • 7,050
  • 13
  • 61
  • 127
0
votes
1 answer

to find a elapsed time in a libevent timer before timer expiry

I have a base code which has a libevent timer started for 480 seconds. After a delay, before the timer expiry, I wanted to find the number of seconds elapsed in that timer.
svaithin
  • 75
  • 1
  • 7
0
votes
3 answers

Libevent bufferevent socket flush

I'll keep is short. How do I flush data waiting in a bufferevent output buffer directly to the socket in a blocking manner. Upon closing my socket wrapper class after making an asynchronous write (using evbuffer_add), libevent spits out epoll errors…
Dylan
  • 572
  • 5
  • 10
0
votes
0 answers

Libevent HiRedis HTTP Server : Memory Leak in evhttp_send_reply

I'm running the code located here which runs a simple HTTP Server using Libevent. I ran a simple valgrind with the binary, and here's the output, which shows a leak towards evhttp_send_reply & evhttp_make_header :: L349 && L350 The leak shows a…
user1460887
  • 245
  • 1
  • 2
  • 10
0
votes
2 answers

a strange result on my libevent http client

I implemented an http client using libevent's http.h but I have some bug when trying to make-http request. What's more strange is that bug doesn't always happen when downloading files. I used evhttp_request_new and evhttp_request_free and…
0
votes
1 answer

libpcap: real time usage of file descriptor returned by pcap_get_selectable_fd

I'm programming for a network program using libevent. In this program, I want to capture packets using libpcap, modify these packets and then sends them out. These steps should be in real time. So I create a live capture, use pcap_get_selectable_fd…
misteryes
  • 2,167
  • 4
  • 32
  • 58