aykutalparslan/high-perfomance-tcp-server

error on OnCompleted when disconnect

mzelecom opened this issue · 0 comments

on line ( _source.SetResult(BytesTransferred);) this error show.

System.InvalidOperationException: 'Operation is not valid due to the current state of the object.'
`
protected override void OnCompleted(SocketAsyncEventArgs args)
{
if (SocketError != SocketError.Success)
{
_source.SetException(new SocketException((int)SocketError));
}
_source.SetResult(BytesTransferred);
}

`