C++ libuv

234 views
Skip to first unread message

Ashish

unread,
Aug 11, 2013, 2:05:11 PM8/11/13
to li...@googlegroups.com

Do we have c++ release of this library?

My problem is simple. I cannot pass member function as callback to libuv functions.
(e.g. it's tough to pass member function 'alloc_buffer' as a parameter of type 'uv_alloc_cb' to 'uv_read_start')

I saw C++ wrapper here: https://github.com/d5/node.native but its looks pretty old (updated years back)

Any thoughts?

Tnx,
Ashish

Felix Halim

unread,
Aug 11, 2013, 6:59:58 PM8/11/13
to li...@googlegroups.com
I created C++ wrapper for libuv + http-parser to make a simple HTTP server:



I use a simple function for the callbacks, and attach the object to "data".
So that after the callback is called, I can retrieve the object back.

See:



Felix Halim


--
You received this message because you are subscribed to the Google Groups "libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libuv+un...@googlegroups.com.
To post to this group, send email to li...@googlegroups.com.
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ashish

unread,
Aug 12, 2013, 12:32:39 AM8/12/13
to li...@googlegroups.com


Nice :) I started with this only (pointing 'data' to 'this') but was stuck at allock_buffer.
Also didn't realize we can safely use static buffer there, as it's not going to be called by multiple connections simultaneously.

Many thanks for pointers!
Reply all
Reply to author
Forward
0 new messages