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 vs. glib gio: Which is a better option?

I am looking for a C library for asynchronous I/O, TCP/UDP networking support, threads and event loops. I looked at GLib's GIO, GThread, GMainContext, GMainLoop and also Libuv which is used by Node.js. The functionality is similar. THere seems to…
Sunny
  • 9,245
  • 10
  • 49
  • 79
0
votes
2 answers

Send parameters to alloc_cb

I want to use libuv to send files over TCP. My problem is with uv_read_start for reading the content of the file. To do that, I first send the size of the file, so I make a static malloc(sizeof(uint64_t)) in the alloc_cb to read the size. After that…
Grutt
  • 21
  • 3
0
votes
1 answer

Writing a database with async i/o

I recently came across libuv, the low level library that lets nodejs do its async magic. This got me thinking. I would like clarifications along these lines: Nodejs has async i/o calls. However if I'm calling APIs to a (remote) database the actual…
0
votes
0 answers

Linking to libuv. Can't use vsbuild.bat version, own compilation links correctly

After sucessfully building libuv on windows in a mingw64 environment, I'm having a problems linking the libuv.dll/libuv.lib that are built as part of the vsbuild.bat build script. When I build libuv by myself from the sources to produce either a…
Tom Shaw
  • 73
  • 9
0
votes
0 answers

How to use the libuv to accept the tcp connection with multi-thread?

I write a C++ dome of tcp server with the libuv. When I check the cpu performance, I found the dome is a single thread running, how can I implement it with multi-thread? Currently, the dome can hanlde 100,000+ tcp request per second, it can only eat…
E.SHEN
  • 39
  • 1
  • 5
0
votes
0 answers

Boost.Asio or Libuv, which is better for large-scale Linux Servers for enterprise?(by c++)

Boost.Asio or Libuv, which is better for large-scale Linux Servers for enterprise?(by c++) The database will be PostgreSQL. And the client should be app on iPhone and Android. ps. Is golang very popular and effecient right now for Server developing?…
gpu
  • 129
  • 10
0
votes
1 answer

libuv fs read file print one more time

Recently I am writing some c code to simply read file and print out content using libuv. But I don't know why my code would print first buffer twice. void open_cb(uv_fs_t* open_req){ int r = 0; if(open_req -> result < 0 )…
鄭元傑
  • 1,417
  • 1
  • 15
  • 30
0
votes
1 answer

How do I perform a DNS look-up using libuv?

I am trying to use libuv to resolve a URL to an IP address. I am using the function uv_getaddrinfo, which passes an addrinfo object to my call-back. Is this callback where I receive the IP address? How do I extract the IP address from the addrinfo…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
0
votes
0 answers

LNK1181 cannot open input file

I have these errors on visual studio 2017 whenever i try to build/debug the project: LNK1181 cannot open input file 'C:\Program Files\libuv\Release\lib\libuv.lib And this warning dialog: Unable to start program …
Nizar
  • 1,112
  • 4
  • 17
  • 29
0
votes
1 answer

libuv based tcp server not listening on specified port

Wrote a TCP server using libuv, it doesn't listen on the right port. For example, the following is supposed to be listen on TCP port 3005, but it appears to be listening on a random port according to the output of command netstat -antp | grep…
packetie
  • 4,839
  • 8
  • 37
  • 72
0
votes
1 answer

pyuv process executing a function instead of a file

I am developing an application which involves copying potentially large files in response to certain UDP requests. I am using pyuv to listen and handle these requests, and desire a separate process to be spawned off to complete these copy operations…
wakey
  • 2,283
  • 4
  • 31
  • 58
0
votes
0 answers

Node.js uv_async_send

I am compiling a visually designed process model (A series of connected boxes) to run on the Node event loop. I have an instance of a class which uses uv_async_send to "Post" an event, with a callback pointing to another instance of the class. The…
Greycon
  • 793
  • 6
  • 19
0
votes
1 answer

Multi-core multi-process node application and single-core single-process node application performance What is the difference

I'm confused libuv have thread-pool mechanism, What is the necessity of using multiple processes?
bugall
  • 31
  • 5
0
votes
1 answer

How to set thread size of libuv in nodejs?

I have write a demo in nodejs like this: hello.js: var http = require(‘http’); while(true){ console.log(process.env.UV_THREADPOOL_SIZE); } I monitor the process and threads with 'pstree -p | grep node' after starting the program above. I…
Alex.Xing
  • 1
  • 2
0
votes
0 answers

Node.js c++ addon async librarary(libvlc) callback segmentation fault

I'm trying to create wrapper for libvlc for node.js (most of them are deprecated). LibLVC generaate it's events asynchronously, but if I try to call js callback in such event, it encounter segmentation fault. I found solutions for libuv and Nan's…
tino415
  • 109
  • 2
  • 10