help icon indicating copy to clipboard operation
help copied to clipboard

can you provide a multi thread tcp server sample? uv_write2 only works only with multi processes ?

Open cagev opened this issue 7 years ago • 1 comments

uv_write2 can't send file handle to pipe between threads?

I get hints from other posts:

"There is no way to accept a client on another loop. There are a number of things you can do:

create the listener handle, then create X new loops, send the handle to them using uv_write2 and listen in all of them if you're on Linux (> 3.9 IIRC), create X new loops and bind a handle to the same IP and port using SO_REUSEPORT have a single loop accept all incoming connections and send them to other loops using uv_write2." but it doesn't figure out it's in multi threads or multi processes.

cagev avatar Jun 28 '18 09:06 cagev

You can check out benchmark-multi-accept.c!

But there are bugs in Windows!

pony5551 avatar Jan 19 '19 19:01 pony5551