<font face="trebuchet ms,sans-serif">Hi, I&#39;m trying to figure out what values the ShutdownEventArgs.ReplyCode property can be assigned by the .NET client.�</font><div><font face="trebuchet ms,sans-serif">I started investigating while trying to solve a reconnection problem whereby the connection was shutdown by the AppDomain unload event handler and exited with code 0x21d, but noticed there&#39;s at least another case in the code where the ReplyCode is assigned the same value, and it&#39;s in the MainLoop method, in the last chance catch block.�</font></div>

<div><font face="trebuchet ms,sans-serif">Using same codes for different shutdown reasons makes it difficult to distinguish different shutdown scenarios, and I would like to avoid relying on the ReplyText property to discriminate it.�</font></div>

<div><font face="trebuchet ms,sans-serif">So I&#39;m wondering what is the criteria used by the API to set this value and, bumping one thread from some time ago, it would be very nice to have some guidance about how the .NET API behaves when anything goes wrong. Currently I have to say that it&#39;s quite difficult to cope with failure scenarios because the behavior of the API is difficult to predict, and I am under the impression that it is somewhat inconsistent in terms of which exceptions you have to expect to bubble up in different circumstances.</font></div>