-
Notifications
You must be signed in to change notification settings - Fork 570
SOCK_NONBLOCK / SOCK_CLOEXEC syscall issues #1148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@omar391 starting with 1.18 version, GopherJS builds standard library in the same way that Go WebAssembly does, and these constants are unavailable there. That said, to my knowledge GopherJS never properly supported server-side networking. I'm curious why not use native Go if you are building something server-side? |
@nevkontakte, Thanks for the reply but GopherJs has a more complete Based on the readme:
So, to answer your last ques, it's only relevant that we expect to run our Go code in a NodeJS environment. From my experiment, I was able to compile one of Go's HTTP libs. But failed to run fiber's code due to those 2 syscall variables being not present in the node-syscall pkg. My expectation is that, if we can import these(+remaining) LIBC variables in node-syscall pkg then we can run all Go's server code in a Nodejs environment. |
I think you might be mixing up a few different things, so let me try and clarify.
The problem you are encountering is due to Even then, you are not necessarily out of weeds. So if you can tell me more about the actual problem you are trying to solve, I may be able to give you a more helpful advice. If using native Go is not an option for you because you need to integrate with some pre-existing NodeJS code, it may be better for you to use a NodeJS server framework (express.js or similar), and export Go functions into the JS environment as JS functions (that is something GopherJS can do). Or do the opposite, and use native Go and https://github.com/dop251/goja to run JS bits you need. |
This issue hasn't seen any activity in a couple years, so I'm going to close it. If there's anything outstanding that needs to be addressed, please reply, and I'd love to re-open this. |
Uh oh!
There was an error while loading. Please reload this page.
Running a sample socket code throws the following syscall issues:
Error:
GopherJS version:
GopherJS 1.18.0+go1.18.5
Build cmd:
The text was updated successfully, but these errors were encountered: