Skip to content

Instantly share code, notes, and snippets.

@peteraritchie
Created February 22, 2012 15:37
Show Gist options
  • Save peteraritchie/1885584 to your computer and use it in GitHub Desktop.
Save peteraritchie/1885584 to your computer and use it in GitHub Desktop.
beginendwotpl
NetworkStream networkStream = tcpClient.GetStream();
networkStream.BeginWrite(data, 0, data.Length,
OnWriteCompleted, networkStream);
private static void OnWriteCompleted(IAsyncResult ar)
{
NetworkStream myNetworkStream =
(NetworkStream)ar.AsyncState;
myNetworkStream.EndWrite(ar);
// TODO: more, like invoke BeginRead...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment