Closed Eternal21 closed 8 years ago
This doesn't happen when I run the same code inside InboundSocketExample obtained from git, so I either must be doing something wrong, or the Nuget version has an issue. I'll post back when I find what the problem is.
Not a problem with Nuget version, as I can get it working by staring a fresh Console application. I must be doing something wrong then.
Hi,
I have seen very occasional heisenbugs which appear to be multiple socket read threads attempting to read from the same socket, which show garbled reads. These are easily detectable with TRACE level logging.
It's been fixed in this commit: https://github.com/danbarua/NEventSocket/commit/808405555f9275e59887ac4a73eac8c902141a8b which is in the unstable (2.0+) feed on MyGet.
I still have a few issues to iron out before publishing v 2.0 to NuGet but give that a go and see if that helps.
Otherwise, TRACE level logs always help get to the bottom of things.
NLOG: NEventSocket.InboundSocket Worker Thread 1 started
<snip>
NLOG: NEventSocket.InboundSocket Worker Thread 1 started
Yep, ^ that's the culprit. I will see about getting a hotfix on the 1.0 version pushed to NuGet tomorrow.
Thanks for the response. After I replaced the Nuget dll 1.0.2 with the dll I built using latest master, I am getting the expected stream of events.
A simple console application works with 1.0.2, which is what fooled me above. But a project where I put the same code inside a class library, that's being run from a WPF client was not working with 1.0.2. (only after I used the master build, I was able to get it to run correctly).
The joys of multithreaded async programming - this is why the TRACE level logs output a LOT of information, and why issues filed on Github are gratefully received.
@Eternal21 thank you for confirming this issue - I have backported bugfixes onto the v1 branch and pushed v1.1.0 to NuGet
I grabbed the latest NuGet package (1.1.0), and it works as expected. Thanks.
I'm trying to test the library with FreeSWITCH. I'm using the sample code, just subscribing to EventName.All, and checking if I can see the events. I noticed that I would only get an event or two, and then nothing (despite me placing SIP calls across FreeSWITCH, which should generate plenty).
To see what's going on, I added NLog to my test application, which resulted in the following output (pasted below).
It looks like the library throws 'Failed to parse body of event' exception and closes the socket (relevant class is here: https://github.com/danbarua/NEventSocket/blob/38bcd41c3ae6443f73067967b226488112ee01a1/src/NEventSocket/FreeSwitch/EventMessage.cs)
Any ideas?