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

eventbuffer can only read 8 bytes on input?

I am working through some examples on libevent and am running into a problem with reading any string over 8 bytes from the input buffer. I'm going between two computers on my local network. Here is my code for the simple libevent server: #include…
jojeyh
  • 276
  • 1
  • 3
  • 12
0
votes
1 answer

CentOs 6, Php7.1, libevent, nginx returns 502

I am upgrading laravel web application from php5.6 to php7.1 which leads me to upgrading libevent module. Application is async ans based on react library. So I ended with installed: PHP 7.1.12, libevent: 2.1.8 + expressif/pecl-event-libevent. And I…
0
votes
1 answer

compile tor on centos6. Problems with libevent

i have clean centos6 system, try to compile tor from sources. 1st way (installing libevent by yum). I do: yum install libevent2 yum install libevent2-devel ... (inside tor folder): ./configure make and get…
anagamin
  • 3
  • 3
0
votes
2 answers

Large file uploading to a libevent-based HTTP server

I'm trying to write a HTTP to ZeroMQ proxy with libevent (2.0.4) which should be able to handle very large (up to 4GB) file upload. The problem is I don't know how large post requests (larger than memory) are handled by libevent so if you have…
fokenrute
  • 739
  • 6
  • 17
0
votes
1 answer

How to share callbacks in libevent

Most applications that I have made with libevent involve one read callback and whenever a new connection is opened for a request I allocate a new event with ::event_new() and then add that event to the event base via ::event_add() But the problem…
Curious
  • 20,870
  • 8
  • 61
  • 146
0
votes
1 answer

Does libevent support netlink socket

I use netlink to receive an interrupt number from kernel. The application in user space uses libevent to handle TCP/IP request and netlink message. Does libevent support Linux netlink socket? I will appreciate for a simple example.
sfzhang
  • 669
  • 9
  • 18
0
votes
2 answers

Libevent with C++11+ unique_ptr

I've recently tried to wrap libdbus types and libevent types with std::unique_ptr and custom deleter to simplify the code but I have a error with these libraries: /opt/cross/armv7hl-meego-linux-gnueabi/include/c++/4.8.3/bits/unique_ptr.h:65:22:…
VP.
  • 15,509
  • 17
  • 91
  • 161
0
votes
1 answer

Extremely high latency when network gets busy, TCP, libevent

In our C/S based online game project, we use TCP for network transmission. We include Libevent, utilise a bufferevent for each connection to handling with the network I/O automatically. It works well before,but the lagging problem comes to the…
walter
  • 1,199
  • 7
  • 13
0
votes
1 answer

what's the exactly meaning of EV_TIMEOUT in libevent?

In Programming with Libevent book, it says: EV_TIMEOUT This flag indicates an event that becomes active after a timeout elapses. AFAIK, an event associate with socket fd will become active when network IO event is ready, which is notified by…
linrongbin
  • 2,967
  • 6
  • 31
  • 59
0
votes
0 answers

How to set timeval to a random time

I am using libevent to do some tasks after some timeouts, timeouts are randomly selected, and each time they change. The problem is I cannot set timeval variable to a random time. int TIMEOUT = 2000000; // 2 millions micro seconds, which is 2…
MOH
  • 125
  • 1
  • 8
0
votes
3 answers

Shouldn't malloc be asynchronous?

Am I correct to assume that when a process calls malloc, there may be I/O involved (swapping caches out etc) to make memory available, which in turn implies it can block considerable time? Thus, shouldn't we have two versions of malloc in linux, one…
Slawomir
  • 3,194
  • 1
  • 30
  • 36
0
votes
1 answer

PECL: Is the 'event' extension equivalent to 'libevent' in regards to Ratchet?

I am learning WebSockets, and my preferred language is PHP. Naturally I chose to go with the Ratchet library to build my WebSocket servers. So far I've been fairly impressed with the simplicity of Ratchet, but I'm confused about a PECL extension…
Native Coder
  • 1,792
  • 3
  • 16
  • 34
0
votes
1 answer

ajax call to get continuous/streaming data from php libevent client

I am looking for which ajax call or jquery api to be receiving streaming data from php libevent client. The Libevent Client will be receiving data from Libevent Server.c Server.c /* For socket functions */ #include #include…
amachree tamunoemi
  • 817
  • 2
  • 16
  • 33
0
votes
1 answer

How is ev_timer implemented in libev used by nodejs

setTimeout in nodejs is implemented with c language library libev ev_timer. How does ev_timer work? Is it implemented using polling? If I set a timeout of 30 seconds, does any process check for every milliseconds for pending timeouts?
raju
  • 4,788
  • 15
  • 64
  • 119
0
votes
0 answers

Using inet_ntop from libevent

I implement echo server given in the libevent book. I modify accept_conn_cb function so that the server prints the IPv4 address of a newly created connection (in decimal dot notation). The following is my callback static void accept_conn_cb( …
fade2black
  • 546
  • 1
  • 10
  • 26