Giter VIP home page Giter VIP logo

Comments (5)

kozlovic avatar kozlovic commented on June 15, 2024

@museghost Are you using source that include this merged change to attach? #93
The library calls natsLibuv_Attach with natsSock which on Windows is a SOCKET and not an int. So this should work.

Note that in libuv master, the call uv_pool_init_socket has been removed (see libuv/libuv#1166). So your changes would work only in the 1.x branch.

Let's first make sure that you are using the changes described above.
Thanks!

from nats.c.

museghost avatar museghost commented on June 15, 2024

@kozlovic
At first, thank you for your guide. For both two points, here is my situation.

  1. the source what I have used is the latest one after #93 patch already.

  2. For being ready for 2.x branch, hmm... I need to more investigate and test it.

As you see the source of libuv 1.14 branch around uv_poll_init in src/win/poll.c (since line 508), uv_poll_init tries to get the os file handler using uv__os_osfhandler().

And the function might make this issue and that's what I want to check deeply. Then I will let you know it asap.

Also my windows environment is windows server 2012 R2 64 bit with mingw 64 7.1.0.

Thank you again.

from nats.c.

museghost avatar museghost commented on June 15, 2024

@kozlovic
Dear CNATS team

For this issue, it is found at libuv/libuv#1077. According to the libuv dev team, they guided as below.

On Windows uv_poll_init should be used for CRT fds and uv_poll_init_socket for SOCKET handles.

If natsSocket (in fact, ctx->fd) is SOCKET in windows, uv_poll_init_socket() is required as above, however, for 2.0 branch, it might be not feasible.

Could you please tell me your opinion on that ? Do we need a patch ?

Best Regards
Thank you again,

from nats.c.

kozlovic avatar kozlovic commented on June 15, 2024

@museghost Sorry for the delay. Could you try with code from PR #117?

I am using UV_VERSION_MAJOR to detect if running against libuv 1.x or above. As you know, starting in 2.0, they have removed uv_poll_init_socket and actually renamed it to uv_poll_init, so when running with libuv 2.0, we have to call uv_poll_init (since the xx_socket API has been removed) and uv_poll_init_socket on libuv < 2.0.

I have checked and it works for me on MacOS X (tried with libuv 1.16 and master) and Windows (tried with 2.0). Please let me know if it works for you and I will merge it to master.

from nats.c.

kozlovic avatar kozlovic commented on June 15, 2024

@museghost I did not get confirmation that this worked for you, but I went ahead and merged the PR #117. Hope this helps. Thanks!

from nats.c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.