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

Is it possible with libuv to create a client to another loop/thread from the server's loop/thread?

Suppose I've a main loop that handle all the new connection and several thread all running its own loop. I would like to distribute my clients to these loops. Is it thread-safe to create a client in the main thread and pass to the init function…
hl037_
  • 3,520
  • 1
  • 27
  • 58
0
votes
1 answer

How to accept clients in a generic way (tcp / pipe ) with libuv?

I would like to have a generic on_connection callback that works with any type of server stream (pipe or tcp), but to accept the connection, you should provide an initialized client... However uv_stream_t is an abstract struct. Is there an official…
hl037_
  • 3,520
  • 1
  • 27
  • 58
0
votes
1 answer

Compile simple c++ project using libuv in visual studio

I just got familiar with libuv and I tried to create really simple project in visual studio and compile it. I built the libuv project like it was written in the documentation. After the build was complete I added, in the linker the include files…
Gabriel kotev
  • 369
  • 3
  • 15
0
votes
1 answer

Can the uv_write() send a large amount of data at one time?

For example, my buffer to send has 20K bytes (user lists). I wonder if uv_write() can send the 20K bytes at once, not sepearted. So will the callback function, after_write_cb, returns the status 0 of success? That is, Don't I need to care about the…
GT Kim
  • 329
  • 1
  • 4
  • 16
0
votes
1 answer

How to control the transmission speed under libuv?

As we all know, libuv is an asynchronous network library, it will do its best to send out the data, however, in some cases, we can not take all the bandwidth, transmission speed needs to be controlled at the specified value, how to do this with…
Dr.Nemo
  • 1,451
  • 2
  • 11
  • 15
0
votes
3 answers

Passing c++ lambda to C functions

I am trying to wrap a C++ layer over libuv, and using lambda for callback functions. However gcc is erroring out. Here is the minified version: #include class Test { public: void on_conn(uv_stream_t *server, int status) { } void…
vrdhn
  • 4,024
  • 3
  • 31
  • 39
0
votes
2 answers

What happend in libuv when you make parallel requests

As Javascript is a single threaded, how libuv handles when i manage to make two requests parallely? Eg: Making array of promises and resolving latter
RT Bathula
  • 169
  • 1
  • 2
  • 9
0
votes
1 answer

Trying to make simple libuv logger without success

I try to create logger from within the libuv server (simple). I followed the examples I barely found on the net. I do manage to write to file but when I try to write to the log from some different place in the code I'm getting exception. This is…
user63898
  • 29,839
  • 85
  • 272
  • 514
0
votes
1 answer

Does nextTick means next phase in Node.js (Event Loop)?

What does process.nextTick exactly mean ? Does nextTick mean, after callback queue pop for one element in the current phase ? Or before moving to the next phase after executing all callbacks in the current phase's queue ?
faressoft
  • 19,053
  • 44
  • 104
  • 146
0
votes
1 answer

NodeJS C++ native module: Create designated thread pool

for a application I am currently developing, I need to start instances of a shared library in parallel. As I want to have fine-grained control over the amount of parallel instances (-license of library restricts amount of parallelism to a fixed…
0
votes
1 answer

Simple libuv server with two clients keeps calling write callback in a loop after second client connection

I'm playing with libuv and I'm trying to have a simple server that listens on localhost and whenever a client connects, just send a "Hello". The problem is, the server seems to work, but after the first connection the write callback keeps getting…
bitwise
  • 541
  • 6
  • 16
0
votes
1 answer

libuv - How to test for a disconnection of a listening socket from client (relay application)

My application sporadically modifies and relays messages that it receives to a listener server daemon (all using unix domain sockets, so uv_pipe_t). (Workflow that has me stumped) When the first message has to be relayed, it makes a uv_try_write()…
Northstar11
  • 21
  • 1
  • 7
0
votes
1 answer

Are async requests made in a loop guaranteed to be queued in the order of the loop execution?

If I execute a number of asynchronous http requests in a for loop, is the order that those sockets are added to the event loop deterministic/guaranteed to be in the order that the loop executed? function makeRequest(n) { …
dm03514
  • 54,664
  • 18
  • 108
  • 145
0
votes
0 answers

Javascript event loop vs Node event loop

I am learning the basics of Node.js. One thing that constantly confuses me is the event loop. From what I have learned, Node.js handles asynchronous functions using threads in libuv. How does chrome V8 engine handles this?
Nithin Mohan
  • 182
  • 4
  • 13
0
votes
1 answer

How do node.js and libuv use the different threads?

While doing some research on Node.js and libuv I started a simple node server with UV_THREADPOOL_SIZE=1 and looked at pstree to see how much threads it really uses. for Node.js 0.10 pstree -p | grep node produces node(5157)-+-{node}(5158) …
DanielKhan
  • 1,190
  • 1
  • 9
  • 18