Questions tagged [libev]

A full-featured and high-performance event loop that is loosely modelled after libevent, but without its limitations and bugs. It is used, among others, in the GNU Virtual Private Ethernet and rxvt-unicode packages, and in the Deliantra MORPG Server and Client.

A full-featured and high-performance event loop that implements a reactor pattern and event-driven I/O in C. It is loosely modelled after libevent, but without its limitations and bugs

114 questions
0
votes
0 answers

libev with two ev_timer 100%CPU utiluzed

first,my english is very bad... this is my code: ev_timer_init(&m_netmsgpoptimer, netMsgTimer_cb, 10, 10.); ev_timer_start(m_loop, &m_netmsgpoptimer); m_mainlooptimer.data = (void*)this; // ev_timer_init(&m_mainlooptimer, mainloopTimer_cb, 20,…
huhu
  • 1
  • 1
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

Why does syslog.h skip log messages in my C program?

I have a C program that consists of a libev event loop. For one of the watchers there is an inner loop resulting in 100+ log messages (each ~200 characters long). For some reason only a third of the messages make it to the log file. The program does…
c00kiemonster
  • 22,241
  • 34
  • 95
  • 133
0
votes
1 answer

How to use libev for one event, waiting two sockets by two ev_io and ev_watch?

Now I'm writing a proxy server for a specify true server. The architecture of the system can be represent by the graph below: (I actually use multi-threads to handle all clients.) 'client A' ←––––– –––––→ 'proxy server' ←––––– –––––→ 'true…
Kir Chou
  • 2,980
  • 1
  • 36
  • 48
0
votes
1 answer

libev-4.15 doesn't compile on OSX 10.8

I'm trying to upgrade from libev-3.8 (which compiles fine on OSX 10.8) to libev-4.15 and getting the following error. third_party/libev-4.15/ev.h:234: error: expected identifier before numeric constant third_party/libev-4.15/ev.h:234: error:…
vinodkone
  • 2,731
  • 4
  • 22
  • 21
0
votes
1 answer

C++ Server - More than 1024 connections

I have a chat server in C++, running in linux and using the libev libraries. If I try to connect more than 1024 clients it will crash with a -1 file descriptor. I would like to allow more than 1024 concurrent connections to be made to the server.…
Josh Brittain
  • 2,162
  • 7
  • 31
  • 54
0
votes
1 answer

Segmentation fault in libev after fork

I want to make an example application with libev. I want to have a watcher on keyboard input that will parse several commands like "start" "stop" "exit". On "start" I want to create a pipe and fork the application to start some worker(like ffmpeg…
JustAnotherCurious
  • 2,208
  • 15
  • 32
0
votes
1 answer

libev ev_io_stop() does not close socket

I have a server using libev Whenever a client socket breaks the socket connection is stopped using a code like this ev_io_stop(loop, watcher); Do I need to specifically call shutdown() or close()
Ram
  • 1,155
  • 13
  • 34
0
votes
2 answers

Using libev ev_io and ev_idle events together

I am interested in listening to incoming connections and when there is no active connections I want to do background processing. I have not found any examples of both these together. I want to do something similar like this: From one of the…
0
votes
1 answer

libev more then one watcher per fd fails

I can't seem to get working 2 watchers per socket.. Code below doesn't acually works at all, but if i mix up these calls(for ex. call init/set/start for 1 watcher and then for other), i get only 1 watcher working.. Is there something I'm missing…
0
votes
1 answer

libev socket communication fails

I have a libev based socket server that gets messages from multiple simultaneos sockets I use recv() to receive message from the socket. And send() to communicate to the socket The problem is that sometimes even if I do a send() and the output of…
Ram
  • 1,155
  • 13
  • 34
0
votes
2 answers

Monitoring a set of directories and generating "events", when new files appear - can libevent or libev do that?

I'm writing a program in PHP (don't ask), which needs to monitor a set of directories waiting for files to appear and processing newcomers. Can libevent or libev (both have matching PHP-extensions) generate such events? I know, the underlying…
Mikhail T.
  • 3,043
  • 3
  • 29
  • 46
0
votes
1 answer

How to create asynchronous method in C++ using libev

I am trying to create an asynchronous method in C++ using libev. If needed I can pass a callback method as an argument. For instance test(); printf("After test() method\n"); the test() is an asynchronous method, so the next printf() statement…
Chaitanya
  • 3,399
  • 6
  • 29
  • 47
0
votes
1 answer

Why is it evbuffer_add_printf will only accept static variables and not "dynamic" ones?

So far I have gotten my libev code to successfully return a static sting that says "OMP OMP", however when I write a function that returns a "static" string it never seems to work. (Sidenote: the idea is to turn that same function into a dynamic…
Xenland
  • 510
  • 1
  • 6
  • 19
0
votes
2 answers

Get libev remote ip address from this example code?

I'm trying to learn libevent/libev (in this case its libev) from the following link: http://www.ibm.com/developerworks/aix/library/au-libev/ I'm wondering how to find out what the remote ip address is so I can build my own DHT. I'm guessing it has…
Xenland
  • 510
  • 1
  • 6
  • 19