-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I'm trying to re-write this for the .net v4 framework as I need the app to run on Windows Xp. Yes, Xp.
The issue I'm having is with stream.ReadAsync below. Do you know the best alternative?
I tried to using the simple StreamReader but get timeout issues?
ConnectedState.cs 39-58
byte[] buffer = new byte[1024 * 8];
var taskRead = stream.ReadAsync(buffer, 0, buffer.Length, cancelToken);
try
{
taskRead.Wait(cancelToken);
}
catch (Exception ex)
{
_logger.Trace(ex, "ConnectedState.Run");
}
if (!cancelToken.IsCancellationRequested)
{
int bytesRead = taskRead.Result;
if (bytesRead > 0) // stream has not reached the end yet
{
//Console.WriteLine("ReadCallback {0} bytesRead", bytesRead);
string text = Encoding.UTF8.GetString(buffer, 0, bytesRead);
text = mRemainingText + text;
string[] lines = StringSplitter.SplitIntoLines(text, out mRemainingText);
Metadata
Metadata
Assignees
Labels
No labels