Closed nwidger closed 9 years ago
I believe you should create an issue in the gopherjs project. Previously, the same issue existed when built with Windows and was filed under gopherjs/gopherjs#123.
Alternatively, we can stop importing the net
package, though we would no longer implement the net.Conn
interface. (basically, we'd need to revert #6.)
Oops, you're absolutely right. I'll open a ticket with gopherjs, sorry!
No worries! Thanks for reporting the bug. :+1:
I just ran into an issue using the latest versions of
github.com/gopherjs/gopherjs
andgithub.com/gopherjs/websocket
wihch seems to be caused bywebsocket
pulling in the stdlibnet
package.net
has a global variablevar listenerBacklog = maxListenerBacklog()
innet/net.go
which gets initialized during package initialization. In the browser at runtime this initialization causes a call toos.Open("/proc/sys/net/core/somaxconn")
which triggers the following error on the JS console:The solution that worked for me was to add the following stub to
github.com/gopherjs/gopherjs/compiler/natives/net/net.go
:where
0x80
is the value ofsyscall.SOMAXCONN
for Linux. I'm using Go 1.4.1 on linux_amd64.