diff --git a/TLSharp.Core/Auth/Authenticator.cs b/TLSharp.Core/Auth/Authenticator.cs index c56dffc..1342555 100644 --- a/TLSharp.Core/Auth/Authenticator.cs +++ b/TLSharp.Core/Auth/Authenticator.cs @@ -6,7 +6,7 @@ namespace TLSharp.Core.Auth { public static class Authenticator { - public static async Task DoAuthentication(TcpTransport transport, CancellationToken token) + public static async Task DoAuthentication(TcpTransport transport, CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); diff --git a/TLSharp.Core/Network/MtProtoPlainSender.cs b/TLSharp.Core/Network/MtProtoPlainSender.cs index e468084..bace652 100644 --- a/TLSharp.Core/Network/MtProtoPlainSender.cs +++ b/TLSharp.Core/Network/MtProtoPlainSender.cs @@ -18,7 +18,7 @@ namespace TLSharp.Core.Network _random = new Random(); } - public async Task Send(byte[] data, CancellationToken token) + public async Task Send(byte[] data, CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); @@ -38,7 +38,7 @@ namespace TLSharp.Core.Network } } - public async Task Receive(CancellationToken token) + public async Task Receive(CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); diff --git a/TLSharp.Core/Network/MtProtoSender.cs b/TLSharp.Core/Network/MtProtoSender.cs index ff412e1..71e2bc9 100644 --- a/TLSharp.Core/Network/MtProtoSender.cs +++ b/TLSharp.Core/Network/MtProtoSender.cs @@ -33,7 +33,7 @@ namespace TLSharp.Core.Network return confirmed ? _session.Sequence++ * 2 + 1 : _session.Sequence * 2; } - public async Task Send(TeleSharp.TL.TLMethod request, CancellationToken token) + public async Task Send(TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); @@ -61,7 +61,7 @@ namespace TLSharp.Core.Network _session.Save(); } - public async Task Send(byte[] packet, TeleSharp.TL.TLMethod request, CancellationToken token) + public async Task Send(byte[] packet, TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested(); @@ -130,7 +130,7 @@ namespace TLSharp.Core.Network return new Tuple(message, remoteMessageId, remoteSequence); } - public async Task Receive(TeleSharp.TL.TLMethod request, CancellationToken token) + public async Task Receive(TeleSharp.TL.TLMethod request, CancellationToken token = default(CancellationToken)) { while (!request.ConfirmReceived) { @@ -148,7 +148,7 @@ namespace TLSharp.Core.Network return null; } - public async Task SendPingAsync(CancellationToken token) + public async Task SendPingAsync(CancellationToken token = default(CancellationToken)) { token.ThrowIfCancellationRequested();