Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/MiNET/MiNET.Console/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

#endregion

using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using log4net;
using log4net.Config;
Expand Down Expand Up @@ -61,12 +61,15 @@ static void Main(string[] args)
Log.Info(MiNetServer.MiNET);
System.Console.WriteLine(MiNetServer.MiNET);

var currentProcess = Process.GetCurrentProcess();

var processorAffinity = Config.GetProperty("ProcessorAffinity", -1);
if (processorAffinity != -1)
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
currentProcess.ProcessorAffinity = processorAffinity;
var currentProcess = Process.GetCurrentProcess();

var processorAffinity = Config.GetProperty("ProcessorAffinity", -1);
if (processorAffinity != -1)
{
currentProcess.ProcessorAffinity = processorAffinity;
}
}

var service = new MiNetServer();
Expand Down
10 changes: 5 additions & 5 deletions src/MiNET/MiNET/Net/RakNet/RakConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
using System.Net;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using log4net;
Expand Down Expand Up @@ -204,15 +205,14 @@ private static UdpClient CreateListener(IPEndPoint endpoint)
{
var listener = new UdpClient();

if (Environment.OSVersion.Platform != PlatformID.MacOSX)
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
//_listener.Client.ReceiveBufferSize = 1600*40000;
listener.Client.ReceiveBufferSize = int.MaxValue;
//_listener.Client.SendBufferSize = 1600*40000;
listener.Client.SendBufferSize = int.MaxValue;

listener.DontFragment = false;
}

listener.DontFragment = false;
//listener.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 500);
listener.EnableBroadcast = true;

if (Environment.OSVersion.Platform != PlatformID.Unix && Environment.OSVersion.Platform != PlatformID.MacOSX)
Expand Down