Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Null Reference Exception #2

Open
shaneh20 opened this issue Mar 27, 2019 · 1 comment
Open

Unhandled Null Reference Exception #2

shaneh20 opened this issue Mar 27, 2019 · 1 comment

Comments

@shaneh20
Copy link

Hi, I've been using your nice library for a while now and just today we had an issue where we couldn't start one of our windows services that is using this ssdp lib. It was crashing with an unhandled exception being logged in Event Viewer:

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at Discovery.SSDP.MessageParser.GetNotifyMessage(System.Collections.Generic.List`1<System.String>)
at Discovery.SSDP.MessageParser.Parse(Byte[])
at Discovery.SSDP.Agents.AgentBase.ParseResponse(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

I've got a feeling there might be some other SSDP software on our network that is trying to discover its server by broadcasting out the "M-SEARCH * HTTP/1.1" string on port 1900. Looking at your code in the MessageParser class it looks like this might be causing the issue in GetNotifyMessage.

Changing this ssdp lib to use a different port fixed the problem, so it looks like when it uses the default 1900 port it's not handling messages received from other SSDP clients properly.

@shaneh20 shaneh20 changed the title Null Reference Exception Unhandled Null Reference Exception Mar 27, 2019
@simongh
Copy link
Owner

simongh commented Mar 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants