mhowlett / NNanomsg

.NET binding for nanomsg
MIT License
179 stars 52 forks source link

crash if try to send after connection lost #13

Open ghost opened 10 years ago

ghost commented 10 years ago

if you try to send a message throug a PushSocket after the Pull-Client disconnected the whole application crashes with no exception thowen.

mhowlett commented 10 years ago

The nanomsg c library that NNanomsg wraps aborts the process in some situations, including this one I believe, and I'm not aware of anything that can be done at the NNanomsg level to handle it. I tried to raise this in the nanomsg mailing list, but didn't get anywhere. This behavior also causes problems for me.

kwpatrick commented 10 years ago

Is there a corresponding nanomsg bug open?

Matt, did you have a workaround? If not we might consider marking the push pull as deprecated until the behavior improves. On Jun 30, 2014 10:46 AM, "Matt Howlett" notifications@github.com wrote:

The nanomsg c library that NNanomsg wraps aborts the process in some situations, including this one I believe, and I'm not aware of anything that can be done at the NNanomsg level to handle it. I tried to raise this in the nanomsg mailing list, but didn't get anywhere. This behavior also causes problems for me.

— Reply to this email directly or view it on GitHub https://github.com/mhowlett/NNanomsg/issues/13#issuecomment-47540362.

mhowlett commented 10 years ago

This was a general comment about the use of nn_assert in many places in the nanomsg, which I was guessing is the problem here.

nn_assert calls the stdlib function abort which sends SIGABRT.

when I was looking before I thought I deduced a call to nn_assert was not catchable. however this page: http://www.cplusplus.com/reference/cstdlib/abort/ includes the text "... if uncaught ..." implying it is possible.

I will look in to this soonish if no resolution - the issue affects me also - but super busy ATM with something else.

mhowlett commented 10 years ago

looks relevant

http://stackoverflow.com/questions/8934879/how-to-handle-sigabrt-signal

ghost commented 10 years ago

seems to be solved after update to 0.4-beta