TLSharp/TLSharp.Core
Andres G. Aragoneses 5e9bb6163f Throw FloodException instead of calling Thread.Sleep()
Doing this is better when looking at the problem from at least
these 2 points of view:

a) You're working on TLSharp itself: You might be testing some
new things or running TLSharp's tests. Suddenly, if a FLOOD_WAIT
response happens, there's no clear way to know. You just see the
tests taking forever. But if a test has reached a situation in
which Telegram has returned a FLOOD_WAIT error, it's very likely
that what happens is that the TLSharp operation being tested is
actually buggy, which means that the test should FAIL FAST and
show a stacktrace of the problem so that you can see where in the
code was the FLOOD_WAIT received/caused. You shouldn't need to
kill the run of the test suite and hope to hit the problem again
only when you were using the debugger (to be able to pause
execution and examine a stacktrace of where the execution flow is).

b) You're using TLSharp: if you hit a FLOOD_WAIT problem it may
happen because:

b1) TLSharp has a bug: in this case it's better to throw an
exception so that the user can copy the stacktrace and paste
it into a new Github issue.

b2) Your program uses TLSharp sending excessive requests: you
want to have your program know when you hit the limit, to be
able to fix your program to not be so floody. But a call to
Thread.Sleep() doesn't help you to know this, you just know
that suddenly your program has hung, and you don't know why.
You cannot react to the problem, however with an exception you
can react to the problem (for example by examining the time
that the exception provides, as a TimeSpan property, to know
how much your program needs to wait to be able to use TLSharp
again).
2016-11-01 23:52:58 +08:00
..
Auth Fix spelling of Receive 2016-07-20 08:15:28 +01:00
MTProto Update Everything 2016-09-22 17:01:59 +03:30
Network Throw FloodException instead of calling Thread.Sleep() 2016-11-01 23:52:58 +08:00
Properties TLSharp and Tests 2015-09-28 10:01:17 +08:00
Requests Move upload helper to helpers 2016-10-23 14:12:34 +03:00
Utils Move upload helper to helpers 2016-10-23 14:12:34 +03:00
packages.config Redesign Everything 2016-09-24 17:08:26 +03:30
Session.cs - Layer 53 2016-10-15 13:35:54 +03:00
TelegramClient.cs Merge pull request #277 from knocte/friendlerAuthTestFailures 2016-10-31 11:12:36 +03:00
TLSharp.Core.csproj Move upload helper to helpers 2016-10-23 14:12:34 +03:00
TLSharp.Core.nuspec another fix 2016-10-29 17:13:28 +03:00