sochix / TLSharp

Telegram client library implemented in C#
1.01k stars 380 forks source link

Adds ConfigureAwait(false) and CancellationToken to all async methods #883

Closed IaRuslan closed 4 years ago

IaRuslan commented 4 years ago

Hi, guys. Thank you for your library. It's very useful. But I've got deadlocks in TcpTransport.Receive, so I added ConfigureAwait(false) to all async method calls to solve the problem. Also I added CancellationToken to methods parameters.

knocte commented 4 years ago

Thanks for your contribution! I'm going to do a review now, please bear with me.

knocte commented 4 years ago

I actually looked at the code and the most prevailing style is to not have _ as a prefix for private fields. These are only a few cases, not the majority. So we should rather make it uniform to not have this, instead of adding it to the ones missing it.

knocte commented 4 years ago

Hey @IaRuslan , you never pinged me about your last push, so I didn't know this PR was finished. But then there were some other changes which made this PR have conflicts, my bad!

Fortunately @CheshireCaat has picked up the work and brought your changes, and he mentioned you in the commit!: c5a2c816fc4ea920c40d3e0a85708470dced2ac6

Thanks for the work guys!