Coder Social home page Coder Social logo

Comments (6)

headius avatar headius commented on July 21, 2024

I would not expect this library to work at all on Windows since there's no unix socket support there. The error is pretty weird but even without that it wouldn't work anyway.

from jnr-unixsocket.

headius avatar headius commented on July 21, 2024

So I think the only thing to do here would be to make the error more explicit about not working on Windows. Despite the odd error, this is failing to locate the "socket" function. I will look into improving that error and also making jnr-unixsocket report that it can't run on Windows.

from jnr-unixsocket.

headius avatar headius commented on July 21, 2024

If you get a chance, can you run this passing -Djnr.ffi.asm.enabled=false to the JVM? It would get me a better stack trace. I don't have Windows handy at the moment.

from jnr-unixsocket.

headius avatar headius commented on July 21, 2024

Thank you @enebo for providing the longer trace I requested above:

java.lang.UnsatisfiedLinkError: native method 'socket' not found for method public abstract int jnr.unixsocket.Native$LibC.socket(int,int,int)
        at jnr.ffi.provider.jffi.DefaultInvokerFactory$FunctionNotFoundInvoker.invoke(DefaultInvokerFactory.java:466)
        at jnr.ffi.provider.NativeInvocationHandler.invoke(NativeInvocationHandler.java:47)
        at com.sun.proxy.$Proxy6.socket(Unknown Source)
        at jnr.unixsocket.Native.socket(Native.java:92)
        at jnr.unixsocket.UnixServerSocketChannel.<init>(UnixServerSocketChannel.java:43)
        at jnr.unixsocket.UnixServerSocket.<init>(UnixServerSocket.java:32)
        at jnr.unixsocket.UnixServerSocketChannel.open(UnixServerSocketChannel.java:53)
        at jnr.unixsocket.UnixSocketChannelTest.startServer(UnixSocketChannelTest.java:95)
        at jnr.unixsocket.UnixSocketChannelTest.testInterruptRead(UnixSocketChannelTest.java:59)

On that system it appears that the encoding of the string is correct, but I do not see your original error in the issue report. What code page or encoding do you have configured on Windows? I suspect it's a multi-byte encoding that's getting mangled in our error message here.

In any case, there's only two things to fix:

  • Ensure the function name is encoded properly for the error message, when it does not exist (probably a jnr-ffi fix)
  • Fail earlier in jnr-unixsocket when the necessary functions can't be linked.

from jnr-unixsocket.

Wenenen avatar Wenenen commented on July 21, 2024

So I think the only thing to do here would be to make the error more explicit about not working on Windows. Despite the odd error, this is failing to locate the "socket" function. I will look into improving that error and also making jnr-unixsocket report that it can't run on Windows.

Thank you very much for replying to this question. I have just learned that windows does not support unix domain socket. I want to run unix domain socket on windows mainly because my development environment is windows, but my running environment is linux, so I am switching the development environment to a linux server, hoping to run normally there.

from jnr-unixsocket.

headius avatar headius commented on July 21, 2024

@Wenenen Good luck!

from jnr-unixsocket.

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.