Skip to content

Commit

Permalink
Merge pull request #2858 from notsure2/update-last-activity-on-send-t…
Browse files Browse the repository at this point in the history
…cp-handler

Update TCPHandler.lastActivity upon successful send of bytes.
  • Loading branch information
celeron533 authored Apr 21, 2020
2 parents d8c9a7c + ede2fca commit 6962cfe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shadowsocks-csharp/Controller/Service/TCPRelay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,12 @@ private void PipeRemoteSendCallback(IAsyncResult ar)
var session = (AsyncSession)container[0];
var bytesShouldSend = (int)container[1];
int bytesSent = session.Remote.EndSend(ar);

if (bytesSent > 0)
{
lastActivity = DateTime.Now;
}

int bytesRemaining = bytesShouldSend - bytesSent;
if (bytesRemaining > 0)
{
Expand Down

0 comments on commit 6962cfe

Please sign in to comment.