TelegramClient: change Connect() to return void instead of always true

If a method that returns bool is never returning false,
it's essentially not giving any information at all, which
means that it should return void. This will help the
consumers of this API to stop thinking that the result
of this function means if the connection was succesful
(which it is, actually, but it was never returning false
because if there's any problem connecting, the result would
be an exception instead).
This commit is contained in:
Andres G. Aragoneses 2018-03-01 23:41:35 +08:00
parent 4ce0f72d6d
commit bf568d80cc

View file

@ -50,7 +50,7 @@ namespace TLSharp.Core
_transport = new TcpTransport(_session.ServerAddress, _session.Port, _handler);
}
public async Task<bool> ConnectAsync(bool reconnect = false)
public async Task ConnectAsync(bool reconnect = false)
{
if (_session.AuthKey == null || reconnect)
{
@ -77,8 +77,6 @@ namespace TLSharp.Core
await _sender.Receive(invokewithLayer);
dcOptions = ((TLConfig)invokewithLayer.Response).DcOptions.ToList();
return true;
}
private async Task ReconnectToDcAsync(int dcId)