Added net45 TFM
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#if NETSTANDARD1_3
|
||||
#if DEFAULTUDPCLIENT
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
@@ -85,7 +85,11 @@ namespace Discord.Net.Udp
|
||||
|
||||
if (_udp != null)
|
||||
{
|
||||
#if UDPDISPOSE
|
||||
try { _udp.Dispose(); }
|
||||
#else
|
||||
try { _udp.Close(); }
|
||||
#endif
|
||||
catch { }
|
||||
_udp = null;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Discord.Net.Udp
|
||||
{
|
||||
public static class DefaultUdpSocketProvider
|
||||
{
|
||||
#if NETSTANDARD1_3
|
||||
#if DEFAULTUDPCLIENT
|
||||
public static readonly UdpSocketProvider Instance = () =>
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NETSTANDARD1_3
|
||||
#if DEFAULTWEBSOCKET
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -206,10 +206,14 @@ namespace Discord.Net.WebSockets
|
||||
|
||||
//Use the internal buffer if we can get it
|
||||
resultCount = (int)stream.Length;
|
||||
if (stream.TryGetBuffer(out ArraySegment<byte> streamBuffer))
|
||||
#if MSTRYBUFFER
|
||||
if (stream.TryGetBuffer(out var streamBuffer))
|
||||
result = streamBuffer.Array;
|
||||
else
|
||||
result = stream.ToArray();
|
||||
#else
|
||||
result = stream.GetBuffer();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Discord.Net.WebSockets
|
||||
{
|
||||
public static class DefaultWebSocketProvider
|
||||
{
|
||||
#if NETSTANDARD1_3
|
||||
#if DEFAULTWEBSOCKET
|
||||
public static readonly WebSocketProvider Instance = () =>
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user