Added net45 TFM

This commit is contained in:
RogueException
2017-04-26 10:25:08 -03:00
parent f8b9acc4a1
commit a306d83283
33 changed files with 82 additions and 57 deletions

View File

@@ -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;
}

View File

@@ -4,7 +4,7 @@ namespace Discord.Net.Udp
{
public static class DefaultUdpSocketProvider
{
#if NETSTANDARD1_3
#if DEFAULTUDPCLIENT
public static readonly UdpSocketProvider Instance = () =>
{
try

View File

@@ -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

View File

@@ -4,7 +4,7 @@ namespace Discord.Net.WebSockets
{
public static class DefaultWebSocketProvider
{
#if NETSTANDARD1_3
#if DEFAULTWEBSOCKET
public static readonly WebSocketProvider Instance = () =>
{
try