Questions tagged [libuv]

libuv is a platform layer for Node written in C. Its purpose is to abstract IOCP on Windows and libev-like functionality on Unix systems.

libuv is a platform layer for node.js written in C. Its purpose is to abstract IOCP on Windows and libev on Unix systems. It is intended to eventually contain all platform differences in this library.

400 questions
0
votes
1 answer

LIBUV : SO_REUSEPORT issue in Linux

I have a UDP server in C based on libuv, we have a : Main Thread : that receives an UDP packet that and enqueues it to one of the 4 queues and invokes a dequeue callback to one of the 4 workers. The main thread is bind() to port 9930 4 Worker…
melwin_jose
  • 315
  • 3
  • 20
0
votes
1 answer

Why node.js+mongodb does not gives 100 req/sec throughput for 100 req sent in a second?

I kept node.js sever on one machine and mongodb sever on another machine. requests were mixture of 70% read and 30% write. It is observed that at 100 request in a second throughput is 60req/sec and at 200 requests second throughput is 130 req/sec.…
djsharma
  • 63
  • 1
  • 7
0
votes
1 answer

what does uv_loop_t.time represent?

In libuv's uv_loop_t, there is a private uint64 field called "time". What does it represent?
marathon
  • 7,881
  • 17
  • 74
  • 137
0
votes
0 answers

Strange symbols when i'm trying to get char array from structure

I'm working with libuv (https://github.com/joyent/libuv) and nodejs v12. I I write native module, in this module i have struct: struct Work_req { const char *data; size_t data_length; Isolate* isolate; …
user4176305
  • 141
  • 7
0
votes
1 answer

Is it possible to register events with nginx's event loop?

I want a web server based on nginx, which receives a HTTP message, parses it and checks in Redis for a given key's value and send back a response, all this has to be done asynchronously / non-blocking read/write from Redis. Is it possible? I went…
melwin_jose
  • 315
  • 3
  • 20
0
votes
1 answer

C/CPP Macro or a pre processor to handle multiple versions of a method

How do handle multiple versions of a method in my node addon when compiling across multiple versions of node. For ex: uv_inet_pton and uv_inet_pton of node version 0.10* is different than 0.12.*. The return type is different in these versions. Can I…
Royal Pinto
  • 2,869
  • 8
  • 27
  • 39
0
votes
1 answer

libuv event loop: prepare handle and check handle usage

What is the reason to invoke the prepare handle callback and the check handle callback in the libuv event loop?
ftes
  • 601
  • 1
  • 7
  • 14
0
votes
2 answers

Reference to static member function & inheritance

I'm using libuv in a C++ program. I have two classes, A and B that inherit from C. I use libuv and declared an instance of uv_signal_t on C. Creating an instance of uv_signal_t requires a callback to be passed. I can easily pass a lambda to the C…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
0
votes
1 answer

How to catch SIGABRT inside a nodejs process?

I do hundreds of request per second using the request module in nodejs and sometimes i get the following error nodejs: ../deps/uv/src/unix/async.c:149: uv__async_io: Assertion `n == sizeof(val)' failed. Code: null Signal: SIGABRT how can i catch…
0x4139
  • 73
  • 2
  • 10
0
votes
1 answer

libuv combines mutliple async calls and invokes callback once

Requirement : A UDP server that on receiving an UDP packet and stores the received packet to one of the two queues. A worker thread is associated with each queue, and the associated thread picks up packet from the front of the queue, processes it…
melwin_jose
  • 315
  • 3
  • 20
0
votes
1 answer

How does one use libuv and POLLPRI together?

I write applications against an API defined as Linux character devices with most of the interesting parts of the API defined as ioctl() calls, where asynchronous events are communicated to the application when the drivers raise POLLPRI through…
cardiff space man
  • 1,442
  • 14
  • 31
0
votes
1 answer

v8, libuv, nodejs, win32 api - how to call EnumWindows and have callback call javascript function?

I'm trying to write a C++ library, using v8, for node.js. My only goal is to allow javascript to call EnumWindows, the win32 api function. The EnumWindows method itself takes a callback function as a parameter. It will call that function for every…
Ryan
  • 7,733
  • 10
  • 61
  • 106
0
votes
3 answers

libuv tcp connections issue

I have the following code: #include #include #include "uv.h" int64_t counter = 0; void on_new_connection(uv_stream_t *server, int status); int main(void) { uv_tcp_t server; uv_tcp_init(uv_default_loop(), &server); …
amurdaca
  • 57
  • 1
  • 5
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

uvlib for game server

I know there are some background threads and they executes IO operations etc. and after that, my callback is called. Is all callbacks called in one thread (= not two callbacks can be executed same time)? For example callback passed to uv_read_start…
Krab
  • 6,526
  • 6
  • 41
  • 78
1 2 3
26
27