I'm writing an asynchronous read callback function and as I'm learning C# at the moment would like to ask if the following is recursive (It's not mine but mine will be similar is construct):
protected void ReadCompleted(IAsyncResult iResult)
{
byte[] byIn = (byte[])iResult.AsyncState;
try
{
File.EndRead(iResult);
try
{
HandleDataReceived(byIn);
}
finally
{
BeginAsyncRead(); //recursion??
}
}
catch (IOException ioexc)
{
// Device has been removed!
}
}
Now I'm not particularly against recursion but I like to avoid it when writing something with the potential for huge memory consumption. this whole function itself is called from within BeginAsync().