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
147
votes
8 answers

Nodejs Event Loop

Are there internally two event loops in nodejs architecture? libev/libuv v8 javascript event loop On an I/O request does node queue the request to libeio which in turn notifies the availability of data via events using libev and finally those…
Tamil
  • 5,260
  • 9
  • 40
  • 61
107
votes
3 answers

What's the difference between libev and libevent?

Both 2 libs are designed for async i/o scheduling, and both engages epoll on linux, and kqueue on FreeBSD, etc. Except superficial differences, I mean what is the TRUE difference between these two libraries? regarding to architecture, or design…
ciphor
  • 8,018
  • 11
  • 53
  • 70
39
votes
3 answers

How to increase limits on sockets on osx for load testing?

I'm creating a load tester that uses libev to create lots of open tcp connections to an app i'm working on. Currently it bombs out at 256 connections, due to the nofiles limit: ulimit -n 256 I can increase this to 1024 by doing the below: ulimit -n…
Chris
  • 39,719
  • 45
  • 189
  • 235
24
votes
2 answers

Libev, How to pass arguments to relevant callbacks

I'm trapped in a situation of argument passing in libev. Usually, libev receives packages in a function like *receive_callback*, that's OK, but in practice, we need to dispatch a relative *write_callback* to deal with specific jobs according to the…
user1302372
  • 241
  • 2
  • 5
22
votes
1 answer

Is the first field of a C structure always guaranteed to be at offsetof 0?

Regarding the C programming language... Part of the question at C/C++ Structure offset states that "& does not always point at the first byte of the first field of the structure" But looking over the "ANSI Rationale" at…
user2088639
21
votes
3 answers

Why use do { } while (0) in macro definition?

Possible Duplicate: Why are there sometimes meaningless do/while and if/else statements in C/C++ macros? I met code like below: #define ev_io_init(ev,cb,fd,events) \ do { \ ev_init ((ev), (cb)); \ ev_io_set ((ev),(fd),(events)); \ } while…
ciphor
  • 8,018
  • 11
  • 53
  • 70
9
votes
3 answers

Libev on Windows

Considering libevent vs. libev. Does the libev library have native support of IOCP on Windows?
Cartesius00
  • 23,584
  • 43
  • 124
  • 195
7
votes
3 answers

OpenSSL read client certificate error using libev with non-blocking sockets

I've spent some time searching the interwebs looking for a better way to analyze and debug my issue, but I can't seem to find a solution. So I figured I'd ask. Briefly. I'm attempting to create a non-blocking ssl forwarding proxy. The server…
madczar
  • 71
  • 3
6
votes
2 answers

what does readable/writable mean in a socket file descriptor? And why regular files don't bother with that?

Since I'm new in learning libev recently, there's a readable/writable concept in a io_watcher that I don't quite understand. For my knowledge there's a parameter in linux system programming: O_ASYNC A signal (SIGIO by default) will be generated…
user2269707
6
votes
2 answers

using libev with multiple threads

I want to use libev with multiple threads for the handling of tcp connections. What I want to is: The main thread listen on incoming connections, accept the connections and forward the connection to a workerthread. I have a pool of workerthreads.…
user2004360
  • 209
  • 2
  • 3
  • 8
5
votes
3 answers

Using boost::bind() across C code, will it work?

Can I use boost::bind(mycallback, this, _1, _2) across C code? Update The short answer is no, boost bind does not return a function pointer, which can be called in C code, but a functor (C++ object with overloaded () operator) see answer below.
unixman83
  • 9,421
  • 10
  • 68
  • 102
5
votes
1 answer

Libev: how to schedule a callback to be called as soon as possible

I'm learning libev and I've stumbled upon this question. Assume that I want to process something as soon as possible but not now (i.e. not in the current executing function). For example I want to divide some big synchronous job into multiple pieces…
freakish
  • 54,167
  • 9
  • 132
  • 169
5
votes
2 answers

Is libuv just a wrapper on libev on POSIX systems?

I am really confused between libev and libuv. Is libuv just a wrapper on libev on POSIX systems? If not where does it differ?
4
votes
3 answers

Libev - I/O callbacks

I have a chat server in C/Linux using TCP sockets. When using libev I am able to create an ev_io watcher for read events once for a socket. Something like: ev_io* new_watcher = (ev_io*)malloc(sizeof(ev_io)); //initialize the…
Josh Brittain
  • 2,162
  • 7
  • 31
  • 54
4
votes
2 answers

Why would someone define macros for first parameter including comma in C?

Inside ev.h of libev, I found some macros that seems weird that can't understand: 173 # define EV_P struct ev_loop *loop /* a loop as sole parameter in a declaration */ 174 # define EV_P_ EV_P, /* a loop as first of multiple…
igonejack
  • 2,366
  • 20
  • 29
1
2 3 4 5 6 7 8