fsprojects/IfSharp

socket exception starting kernel (Ubuntu 16.04.1, Mono 4.6.0)

jonschoning opened this issue · 2 comments

Unhandled Exception:
System.Net.Sockets.SocketException (0x80004005): Operating system sockets do not support ReuseAddress.
If your socket is not intended to bind to the same address and port multiple times remove this option, otherwise you should ignore this exception inside a try catch and check that ReuseAddress is true before binding to the same address and port multiple times.
  at System.Net.Sockets.Socket.SetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, System.Int32 optionValue) [0x0003d] in <affe4060066c42de8cdd6027cdb92b56>:0 
  at System.Net.Sockets.Socket.SetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, System.Boolean optionValue) [0x0000e] in <affe4060066c42de8cdd6027cdb92b56>:0 
  at NetMQ.Core.Utils.Signaler..ctor () [0x0002e] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at NetMQ.Core.Mailbox..ctor (System.String name) [0x00012] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at NetMQ.Core.Ctx..ctor () [0x00035] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at NetMQ.NetMQContext.Create () [0x00000] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at IfSharp.Kernel.IfSharpKernel..ctor (IfSharp.Kernel.ConnectionInformation connectionInformation) [0x00010] in <573639321b085d3da745038332393657>:0 
  at IfSharp.Kernel.App.Start (System.String[] args) [0x00068] in <573639321b085d3da745038332393657>:0 
  at IfSharpConsole.Program.Main (System.String[] args) [0x00014] in <f9ae360469824df8a0dac21608d2a080>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException (0x80004005): Operating system sockets do not support ReuseAddress.
If your socket is not intended to bind to the same address and port multiple times remove this option, otherwise you should ignore this exception inside a try catch and check that ReuseAddress is true before binding to the same address and port multiple times.
  at System.Net.Sockets.Socket.SetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, System.Int32 optionValue) [0x0003d] in <affe4060066c42de8cdd6027cdb92b56>:0 
  at System.Net.Sockets.Socket.SetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, System.Boolean optionValue) [0x0000e] in <affe4060066c42de8cdd6027cdb92b56>:0 
  at NetMQ.Core.Utils.Signaler..ctor () [0x0002e] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at NetMQ.Core.Mailbox..ctor (System.String name) [0x00012] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at NetMQ.Core.Ctx..ctor () [0x00035] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at NetMQ.NetMQContext.Create () [0x00000] in <f8f8aec48f4a460eb0ff15702f5ff345>:0 
  at IfSharp.Kernel.IfSharpKernel..ctor (IfSharp.Kernel.ConnectionInformation connectionInformation) [0x00010] in <573639321b085d3da745038332393657>:0 
  at IfSharp.Kernel.App.Start (System.String[] args) [0x00068] in <573639321b085d3da745038332393657>:0 
  at IfSharpConsole.Program.Main (System.String[] args) [0x00014] in <f9ae360469824df8a0dac21608d2a080>:0 

This appears to be a Mono 4.6.* issue with NetMQ.

For reference:

zeromq/netmq#592

zeromq/netmq#623

I installed Mono 4.6.1 and I now have the same issue.

I've submitted a Mono patch that will ship with Mono 4.8. Meanwhile, Mono 4.4 does work, but Mono 4.6 does not. I'm closing this issue here since it's a Mono bug. Thanks very much for the report!