[Mono-dev] BeginTryReceiveRequest and Socket error handling?

Rob Wilkens robwilkens at gmail.com
Wed Jun 27 23:56:39 UTC 2012


On 06/27/2012 01:21 PM, Andres G. Aragoneses wrote:
> On 27/06/12 14:09, Rob Wilkens wrote:
>> This code:
>>                                           try {
>>                                                  return
>> TryReceiveRequest
>> (tout, out ctx);
>>                                          } finally {
>>                                                  lock
>> (async_result_lock) {
>>
>> CurrentAsyncResult = null;
>>
>> CurrentAsyncThread = null;
>>                                                  }
>>                                          }
>>
>> In ReplyChannelBase.cs, should probably catch and _ignore_
>> SocketException, perhaps after dumping a debug message, if not catch
>> other errors, and then go to the finally.  It's already setting the
>> result to null on failure, but this is continuuing to go on to crash
>> because the message dies not appear to be handled further upstream.
>>
>> This is before "} finally {" do something like:
>>
>>                         } catch (SocketException ex) {
>>                                  //ignore this or print debug message
>> becuase it sets the result to null in finally
>>
>> Anyone have opinions on this?
>
> Trying to describe a modification of the code with words is difficult.
>
> This is why patches exist :) Go and attach your proposal in diff format.

It's attached, more was required than i thought to make it compile, but
i haven't tested it because i don't have sample code to reproduce this
with.  I haven't use WCF before, so i can only presume from the context
of this code that it is somewhat right.  Note, This will probably not
fire an IErrorHandler like it should, but i think first step: Stop
crashing the app altogether.  Next step: File a bug report that
IErrorHandler isn't being called and decide where to fire that from.

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sockex.patch
Type: text/x-patch
Size: 1188 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120627/96528376/attachment.bin>


More information about the Mono-devel-list mailing list