G
Guest
I have built an asychronous TCP Server that uses the thread pool. I have two
levels of exception handling in case the handling of the inner catch block
throws an exception. The outer catch block does nothing put print a string
literal to our logging mechanism. The general structure for this is:
AsyncReceiveCallback
{
try
{
OnReceiveDelegate();
}
catch (SocketException)
{
...
}
catch (ObjectDisposedException)
{
...
}
catch (Exception ex)
{
...
}
}
catch (Exception ex)
{
...
}
}
The OnReceiveDelegate is what handles the application business logic and
this business logic also has exception handling, but in some cases it may not
catch everything. My question here is shouldn't my exception handling in the
AsyncReceiveCallback method catch any unhandled exception returning from the
OnReceiveDelegate method?
levels of exception handling in case the handling of the inner catch block
throws an exception. The outer catch block does nothing put print a string
literal to our logging mechanism. The general structure for this is:
AsyncReceiveCallback
{
try
{
OnReceiveDelegate();
}
catch (SocketException)
{
...
}
catch (ObjectDisposedException)
{
...
}
catch (Exception ex)
{
...
}
}
catch (Exception ex)
{
...
}
}
The OnReceiveDelegate is what handles the application business logic and
this business logic also has exception handling, but in some cases it may not
catch everything. My question here is shouldn't my exception handling in the
AsyncReceiveCallback method catch any unhandled exception returning from the
OnReceiveDelegate method?