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

Integrating open62541 into an existing libev event loop

I have an existing application that makes extensive use of libev for its event loop. I would now like to add OPC UA server functionality, but am unsure how best to integrate the open62541 event loop into libev. The following possibilities come to…
2
votes
0 answers

How do you accept websocket connection with libwebsockets?

All the examples found on warmcat/libwebsockets are all about accepting http requests and serving webpage/files. I am trying to do a websocket connection, ex: ws://123.0.0.1/blah however it won't ever establish the connection properly. I am using…
codenamezero
  • 2,724
  • 29
  • 64
2
votes
1 answer

Does calling a blocking function inside libev event callback function blocks whole app?

I use libev to develope my event-driven app. I like to query remote mysql server inside events. so, Do mysql_real_connect block whole application or just my_read_cb according to following code my_read_cb(EV_P_ ev_io *w, int revents) { …
jafar
  • 345
  • 4
  • 11
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
2 answers

Measure individual time taken using perl AnyEvent

I have a requirement to fetch many http urls and I use AnyEvent::HTTP to do this For every URL I need to measure the time taken how can I do this ? My code (stripped down) is here #!/usr/bin/perl …
Ram
  • 1,155
  • 13
  • 34
2
votes
0 answers

Are there any simple libev/libevent implementations supporting websockets?

I am looking for an echo server example using libev or libevent that accepts websocket connections: a websocket client connects, sends a message and receives it back. SSL websockets should also be supported. Is there such thing available? If not,…
Alec Matusis
  • 781
  • 1
  • 7
  • 16
2
votes
1 answer

LibEV how to correctly buffer?

How can I properly create a write buffer? Currently, I am using a linked list of allocated buffers but most of by writes are only a few bytes. What are your suggestions on creating an efficient write buffer?
erai
  • 185
  • 1
  • 11
2
votes
0 answers

Object temporarily empties between references

I'm working on a very small library to make asynchronous calls across PHP processes, and am experiencing some weird behaviour with regards to referencing objects (and arrays - the same issue happens whether referencing an object or array). The end…
rthrfrd
  • 71
  • 4
2
votes
1 answer

ev_loop() causing valgrind error - address is just below the stack ptr

I am working on a project to implement an IRC daemon in C. This is still in a very early development stage, and all it does for now is to accept new connections on the main process, and for each new connection, it creates a thread. Every message…
Filipe Gonçalves
  • 20,783
  • 6
  • 53
  • 70
2
votes
1 answer

How to use Libev io with mqueue

How do i use ev_io with mqueues? I'm trying to do the following with no luck. #include #include #include #include #include #include #include "ev.h" #define MAX_Q_SIZE 255 #define…
2
votes
3 answers

File descriptor of getch()

I want to use libev to listen for keyboard (keystrokes) events in the terminal. My idea is to use (n)curses getch() and set notimeout() (to be nonblocking) to tell getch() not to wait for next keypress. Is there a file descriptor that getch uses I…
Codeape
  • 288
  • 3
  • 14
2
votes
2 answers

ev_timer callback is called earlier than it should be

I have a problem with ev_timer of libev, please look at the code below: static void timeout_cb(struct ev_loop *loop, ev_timer *timer, int revent) { printf("got an timeout event, current time %s\n", get_current_time()); } int main(int argc, char…
Kery
  • 513
  • 8
  • 22
2
votes
3 answers

compile libev (dev) under CentOS

I was wondering if there were instructions somewhere on how to compile libev-dev on Linux (CentOS) 64 bit. I was not able to locate the dev package associated with libev nor any tutorials on its compilation. p.s: no package managers please - since I…
JohnJ
  • 6,736
  • 13
  • 49
  • 82
2
votes
1 answer

how to check if connection is established when use libev with non-block socket

I have some code use libev on how to deal with connection timeout as below (please refer to http://lists.schmorp.de/pipermail/libev/2011q2/001365.html): sd = create_socket() set_socket_nonblock(sd) connect("127.0.0.1", port) // connect to an invalid…
Kery
  • 513
  • 8
  • 22
2
votes
1 answer

Build libev on android ndk

I'm coding a program that really need libev (not libevent) on Android. I google many time to find how to build libev but unsuccess. Could any one tell me, how to build libev on android. Thank so much.
Phien
  • 148
  • 1
  • 14