Conversation
|
Hi @avatar29A, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution! TTYL, AZPRBOT; |
| /// <summary> | ||
| /// Time utility class. | ||
| /// </summary> | ||
| public static class TimeUtil |
There was a problem hiding this comment.
let's converge on PreciseTimeSpan for these things. ping me to discuss the details on integrating missing pieces there.
There was a problem hiding this comment.
Also, with the other changes done, is there still a point in adding these utility methods?
There was a problem hiding this comment.
I'll see tonight. If I'll change all code, which works with nanoseconds on TimeSpan, I think It will be removed.
There was a problem hiding this comment.
I have changed IdleStateHandler and I am having there two methods, which I think, needs to be moved into a utils class.
TimeSpan Max(TimeSpan t1, TimeSpan t2)
{
return TimeSpan.Compare(t1, t2) == 1 ? t1 : t2;
}
TimeSpan GetSystemTime()
{
return TimeSpan.FromMilliseconds(Environment.TickCount);
}Where do you think is better place for they?
|
@avatar29A #107 is in, see my comments inline regarding this. Please, rebase to latest dev and check the comments on |
731a617 to
ef98333
Compare
| this.promise = promise; | ||
| this.handler = handler; | ||
|
|
||
| promise.ContinueWith(new Action<Task>(this.HandleOperationComplete)); |
There was a problem hiding this comment.
use ContinueWith(Action<Task, object> action, object state) overload, pass this as a state, add a static readonly Action<Task, object> OperationCompleteAction = HandleOperationComplete; and derive WriteTimeoutTask out of state in HandleOperationComplete.
There was a problem hiding this comment.
also pass ExecuteSynchronously in ContinueWith
|
pls address the remaining comments, squash into a single commit and rebase to the latest dev. Apparently it has conflicts with current version. |
ef98333 to
9742041
Compare
|
@avatar29A looks good. Please squash and I'll be happy to merge! |
Modifications: Added new handlers: - IdleStateHandler.cs - ReadTimeoutHandler - WriteTimeoutHandler - ChannelDuplexHandler Added a new utils class for work with time: - TimeUtil.cs
9742041 to
c941859
Compare
|
Ready. |
|
Thanks! |
Implementation Idle connections and timeouts.
Modifications:
Added new handlers:
Added a new utils class for work with time: