Hi guys,
I'm discovering libuv and things are going well _on osx_ and things are 
going not well _on windows_...
I'm trying to set up a tcp server and example I'm following is from here :
https://github.com/litesync/libuv_message_framing

I have two threads that listen on usb inputs and I want them to send a copy 
of their buffer to the tcp server.
first, is tcp the good choice for that task?

at start of the program, I set up a uv_loop for the server like 
in https://github.com/litesync/libuv_message_framing/blob/master/test/test.c
so it's a threaded server:

        uv_barrier_init(&(loop_ptr->barrier), 2);

        uv_thread_create(&(loop_ptr->reader_thread), reader_start, 
loop_ptr);

        /* wait until the listening socket is ready on the reader thread */

        uv_barrier_wait(&(loop_ptr->barrier));


with reader_start() that start an uv loop.


right after, the two threads are created and each one is setting up a 
socket which attempt to connect to the server:

    struct sockaddr_in dest;

    uv_ip4_addr("127.0.0.1", loop_ptr->serverPort ,&dest);

    uv_connect_t* connect = malloc(sizeof(uv_connect_t));

            

    uv_msg_t* socket = malloc(sizeof(uv_msg_t));

    rc = uv_msg_init(loop_ptr->server_loop, socket, UV_TCP);

            

    uv_tcp_connect(connect, (uv_tcp_t*)socket, (const struct sockaddr*)&dest, 
on_connect);


and at this early point, it's not clear for me why it works on osx and why 
it fails on windows...

on windows (uv-1.10.2 MSYS2/GCC), it tells that an assertion failed 
((handle))->activecnt > 0... but not always....


so, can you please tell me what I'm doing wrong.


many thanks,

nico

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to