Update Dependencies and support NS2.0 builds (#1046)
* Update deps, fix test warnings. * Support ns2.0 * Fix typo * Remove ns1.1 support * Net.Http and Net.Websockets.Client are not needed in ns2.0 * Move to net46 per volt * Remove ns1.3 constants
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#if DEFAULTUDPCLIENT
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
@@ -85,11 +84,7 @@ namespace Discord.Net.Udp
|
||||
|
||||
if (_udp != null)
|
||||
{
|
||||
#if UDPDISPOSE
|
||||
try { _udp.Dispose(); }
|
||||
#else
|
||||
try { _udp.Close(); }
|
||||
#endif
|
||||
catch { }
|
||||
_udp = null;
|
||||
}
|
||||
@@ -132,4 +127,3 @@ namespace Discord.Net.Udp
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4,7 +4,6 @@ namespace Discord.Net.Udp
|
||||
{
|
||||
public static class DefaultUdpSocketProvider
|
||||
{
|
||||
#if DEFAULTUDPCLIENT
|
||||
public static readonly UdpSocketProvider Instance = () =>
|
||||
{
|
||||
try
|
||||
@@ -16,12 +15,5 @@ namespace Discord.Net.Udp
|
||||
throw new PlatformNotSupportedException("The default UdpSocketProvider is not supported on this platform.", ex);
|
||||
}
|
||||
};
|
||||
#else
|
||||
public static readonly UdpSocketProvider Instance = () =>
|
||||
{
|
||||
throw new PlatformNotSupportedException("The default UdpSocketProvider is not supported on this platform.\n" +
|
||||
"You must specify a UdpSocketProvider or target a runtime supporting .NET Standard 1.3, such as .NET Framework 4.6+.");
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#if DEFAULTWEBSOCKET
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -209,14 +208,9 @@ namespace Discord.Net.WebSockets
|
||||
|
||||
//Use the internal buffer if we can get it
|
||||
resultCount = (int)stream.Length;
|
||||
#if MSTRYBUFFER
|
||||
if (stream.TryGetBuffer(out var streamBuffer))
|
||||
result = streamBuffer.Array;
|
||||
else
|
||||
result = stream.ToArray();
|
||||
#else
|
||||
result = stream.GetBuffer();
|
||||
#endif
|
||||
|
||||
result = stream.TryGetBuffer(out var streamBuffer) ? streamBuffer.Array : stream.ToArray();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -248,4 +242,3 @@ namespace Discord.Net.WebSockets
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -5,7 +5,6 @@ namespace Discord.Net.WebSockets
|
||||
{
|
||||
public static class DefaultWebSocketProvider
|
||||
{
|
||||
#if DEFAULTWEBSOCKET
|
||||
public static readonly WebSocketProvider Instance = Create();
|
||||
|
||||
public static WebSocketProvider Create(IWebProxy proxy = null)
|
||||
@@ -22,12 +21,5 @@ namespace Discord.Net.WebSockets
|
||||
}
|
||||
};
|
||||
}
|
||||
#else
|
||||
public static readonly WebSocketProvider Instance = () =>
|
||||
{
|
||||
throw new PlatformNotSupportedException("The default WebSocketProvider is not supported on this platform.\n" +
|
||||
"You must specify a WebSocketProvider or target a runtime supporting .NET Standard 1.3, such as .NET Framework 4.6+.");
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user