MiNET icon indicating copy to clipboard operation
MiNET copied to clipboard

System.Net.Sockets.SocketException (55): No buffer space available

Open jarne opened this issue 6 years ago • 8 comments

When starting MiNET, it throws the following error:

OS: macOS Mojave .NET core: 2.1.403

Are you blessed with HW accelerated vectors? Yep!
Operations timed using the system's high-resolution performance counter.
  Timer frequency in ticks per second = 1000000000
  Timer is accurate within 1 nanoseconds
 WARN [?] - No level.dat found at D:\Development\DOES NOT EXIST/level.dat. Creating empty.
 WARN [?] - No level.dat found at D:\Development\DOES NOT EXIST/level.dat. Creating empty.
 WARN [?] - No level.dat found at D:\Development\DOES NOT EXIST/level.dat. Creating empty.
 WARN [?] - We overslept -11ms in thread sleep
ERROR [?] - Error during startup!
System.Net.Sockets.SocketException (55): No buffer space available
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent)
   at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
   at System.Net.Sockets.Socket.set_ReceiveBufferSize(Int32 value)
   at MiNET.MiNetServer.CreateListener() in /Users/jarne/Downloads/MiNET/src/MiNET/MiNET/MiNetServer.cs:line 234
   at MiNET.MiNetServer.StartServer() in /Users/jarne/Downloads/MiNET/src/MiNET/MiNET/MiNetServer.cs:line 195
MiNET running. Press <enter> to stop service.

I'm not able to connect to the server.

jarne avatar Nov 03 '18 10:11 jarne

That's a new one. Have to look into that. I wonder if it is trying to set the socket options, when it really shouldn't do it on any other OS than Windows.

NiclasOlofsson avatar Nov 04 '18 17:11 NiclasOlofsson

@NiclasOlofsson it sets ReceiveBufferSize to int.Max before platformId check so that's the problem. Probably should be moved into that if statement. image

undrfined avatar Nov 04 '18 20:11 undrfined

Should probably check to see if it can give me a proper max size for the platfom in question.

NiclasOlofsson avatar Nov 04 '18 21:11 NiclasOlofsson

Hello, I have the same issue on the same OS. Is there a workaround I could use in the meantime ? Thanks

EDIT; I moved the lines pointed out by undrfined, seems to work

Guillaume351 avatar Dec 10 '18 20:12 Guillaume351

OS X max seems to be 7280*1024 for me.

tpurtell avatar Jan 01 '19 03:01 tpurtell

OSX does not support DontFragment either (on Catalina atleast)

mikroskeem avatar Dec 02 '19 21:12 mikroskeem

Then i would say OSX is a security risk. It's a pretty common attack vector to framgent messages on UDP. And it's really difficult to spot since the IO won't communicate it outside of the "kernel" sort of.

NiclasOlofsson avatar Jan 10 '20 08:01 NiclasOlofsson

Is this still an issue? Do we need to look into this or do we mark this as won't fix? @NiclasOlofsson

kennyvv avatar Dec 19 '21 17:12 kennyvv