I am writing a class that includes several async methods following the
BeginXxx, EndXxx pattern. Some of these methods will call methods in the
framework such as Stream.Read or Socket.Send. Do I need to, or is it
recommended to use the async method calls instead (Stream.BeginRe ad, etc)?
Example:
MyMethod()
{
//...
Stream.Read();// I know this method requires parameters
//
// Should it be this instead?
// Stream.BeginRea d();
// Stream.EndRead( );
//...
}
BeginMyMethod()
{
}
EndMyMethod()
{
}
Thanks,
Josh
BeginXxx, EndXxx pattern. Some of these methods will call methods in the
framework such as Stream.Read or Socket.Send. Do I need to, or is it
recommended to use the async method calls instead (Stream.BeginRe ad, etc)?
Example:
MyMethod()
{
//...
Stream.Read();// I know this method requires parameters
//
// Should it be this instead?
// Stream.BeginRea d();
// Stream.EndRead( );
//...
}
BeginMyMethod()
{
}
EndMyMethod()
{
}
Thanks,
Josh
Comment