Started Discord.Net.Relay

This commit is contained in:
RogueException
2017-02-17 23:12:24 -04:00
parent d321ad3e5c
commit 8630185ac9
11 changed files with 269 additions and 43 deletions

View File

@@ -2,7 +2,6 @@
using Discord.Net.Udp;
using Discord.Net.WebSockets;
using Discord.Rest;
using System;
namespace Discord.WebSocket
{
@@ -10,6 +9,9 @@ namespace Discord.WebSocket
{
public const string GatewayEncoding = "json";
/// <summary> Gets or sets the websocket host to connect to. If null, the client will use the /gateway endpoint.
public string GatewayHost { get; set; } = null;
/// <summary> Gets or sets the time, in milliseconds, to wait for a connection to complete before aborting. </summary>
public int ConnectionTimeout { get; set; } = 30000;
@@ -38,41 +40,8 @@ namespace Discord.WebSocket
public DiscordSocketConfig()
{
#if NETSTANDARD1_3
WebSocketProvider = () =>
{
try
{
return new DefaultWebSocketClient();
}
catch (PlatformNotSupportedException ex)
{
throw new PlatformNotSupportedException("The default websocket provider is not supported on this platform.", ex);
}
};
UdpSocketProvider = () =>
{
try
{
return new DefaultUdpSocket();
}
catch (PlatformNotSupportedException ex)
{
throw new PlatformNotSupportedException("The default UDP provider is not supported on this platform.", ex);
}
};
#else
WebSocketProvider = () =>
{
throw new PlatformNotSupportedException("The default websocket provider 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+.");
};
UdpSocketProvider = () =>
{
throw new PlatformNotSupportedException("The default UDP provider 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
WebSocketProvider = DefaultWebSocketProvider.Instance;
UdpSocketProvider = DefaultUdpSocketProvider.Instance;
}
internal DiscordSocketConfig Clone() => MemberwiseClone() as DiscordSocketConfig;