Created
February 22, 2012 15:32
-
-
Save peteraritchie/1885565 to your computer and use it in GitHub Desktop.
beginendtpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var task = Task.Factory.FromAsync(networkStream.BeginWrite, | |
networkStream.EndWrite, | |
data, 0, data.Length, | |
networkStream); | |
Task<Task<int>> task2 = task.ContinueWith(_ => Task<int>.Factory.FromAsync( | |
networkStream.BeginRead, | |
networkStream.EndRead, | |
incomingData, 0, | |
incomingData.Length, | |
networkStream)); | |
task2.ContinueWith(priorTask => Console.WriteLine("{0} bytes read", priorTask.Result.Result)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment