Page 1 of 1

Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 08:27
by hdradio
It might not be a bug, but it fulls my debug log file.
For a few days I was on vacation and 2 of my streaming servers were offline. I don't use them much so I did not notice that.
Last night something strange happened onair (2 jingles back to back) and I tried to find why this happened. (I am still exploring what is wrong).
I opened the debug folder and I saw the debug files with size of about 200MB each.
I opened one and are full of of these (XX=server ip):

Code: Select all

24/08/2016 20:59:53: System.Net.Sockets.SocketException
No connection could be made because the target machine actively refused it XX.XX.XX.XX:XXXX
   at Bsu.Ksw.Cth4(Object  , FirstChanceExceptionEventArgs  )
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at Un4seen.Bass.Misc.SHOUTcast.CreateSocket(String serveraddress, Int32 port)
   at Un4seen.Bass.Misc.SHOUTcast.SHOUTcastGetStats(String password)
   at Un4seen.Bass.Misc.SHOUTcast.GetListeners(String password)
   at Un4seen.Bass.Misc.BroadCast.GetListeners(String password)
   at ProppFrexx.NetworkStreamingMonitor.pt47(Boolean  )
   at ProppFrexx.NetworkStreamingMonitor.Ut4K(CancellationTokenSource  )
   at ProppFrexx.NetworkStreamingMonitor.<>c__DisplayClass20.<StartNetworkTimer>b__1c()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
This was not happening in past (that servers are offline a lot of times).

Re: System.Net.Sockets.SocketException

Posted: 25 Aug 2016 10:35
by hdradio
In past this exception did not show in debug log. There were many times that those streaming servers were offline.

I have debug log enabled all the time, because it's the only way to trace a bug if that happens at a random time.
If you remember we corrected many bugs in the past because I had debug log enabled.

Re: Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 11:25
by hdradio
I feel more secure to have it enabled all the time. That way YOU can find a bug that has happened only once.
I 've only informed you about the exception shown in debug log. I did not try to solve that problem myself. (I could not even if I wanted :))

By the way: I could find errors in my scripts by looking at the debug log. So I 'll leave it enabled.

My question now is:
Will you change something in your code to not show that exception (because it's just a warning) or my log folder will be full of 200MB daily log files ?

Re: Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 12:03
by hdradio
I have some more info on this.
Although I have stopped that server encoder, the exceptions are still written in debug log.

Re: Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 12:25
by hdradio
I know that you are working on it.
One more exception. This time on my backup pc while I updated my main pc:

Code: Select all

25/08/2016 09:16:39: AssignNextTrackToPlayer (TrackCueOut): no player=C or already assigned1 (Cued, False)
25/08/2016 09:17:05: ProgramScheduler: Scheduler stopped
25/08/2016 09:17:05: Overlay Player closed.
25/08/2016 09:17:05: System.NullReferenceException
Object reference not set to an instance of an object.
   at dCS.TCo.o6sd(Object  , FirstChanceExceptionEventArgs  )
   at ProppFrexx.QueueThreadWorker`1.Dispose(Boolean disposing)
   at ProppFrexx.QueueThreadWorker`1.Dispose()
   at ProppFrexx.ProppFrexx_ONAIR.F67B(Object  , FormClosingEventArgs  )
   at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at DevExpress.Utils.Taskbar.Core.FilterWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
   at System.Windows.Forms.Form.Close()
   at ProppFrexx.ProppFrexx_ONAIR.X67L(Object  , ItemClickEventArgs  )
   at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarItemLink.OnLinkClick()
   at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
   at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
   at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at dCS.TCo.k6sM(String[]  )


25/08/2016 09:17:05: System.NullReferenceException
Object reference not set to an instance of an object.
   at dCS.TCo.o6sd(Object  , FirstChanceExceptionEventArgs  )
   at ProppFrexx.QueueThreadWorker`1.Dispose(Boolean disposing)
   at ProppFrexx.QueueThreadWorker`1.Dispose()
   at ProppFrexx.ProppFrexx_ONAIR.F67B(Object  , FormClosingEventArgs  )
   at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at DevExpress.Utils.Taskbar.Core.FilterWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
   at System.Windows.Forms.Form.Close()
   at ProppFrexx.ProppFrexx_ONAIR.X67L(Object  , ItemClickEventArgs  )
   at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarItemLink.OnLinkClick()
   at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
   at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
   at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at dCS.TCo.k6sM(String[]  )


25/08/2016 09:17:05: System.NullReferenceException
Object reference not set to an instance of an object.
   at dCS.TCo.o6sd(Object  , FirstChanceExceptionEventArgs  )
   at ProppFrexx.QueueThreadWorker`1.Dispose(Boolean disposing)
   at ProppFrexx.QueueThreadWorker`1.Dispose()
   at ProppFrexx.ProppFrexx_ONAIR.F67B(Object  , FormClosingEventArgs  )
   at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at DevExpress.Utils.Taskbar.Core.FilterWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
   at System.Windows.Forms.Form.Close()
   at ProppFrexx.ProppFrexx_ONAIR.X67L(Object  , ItemClickEventArgs  )
   at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarItemLink.OnLinkClick()
   at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
   at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
   at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at dCS.TCo.k6sM(String[]  )


25/08/2016 09:17:05: System.NullReferenceException
Object reference not set to an instance of an object.
   at dCS.TCo.o6sd(Object  , FirstChanceExceptionEventArgs  )
   at ProppFrexx.QueueThreadWorker`1.Dispose(Boolean disposing)
   at ProppFrexx.QueueThreadWorker`1.Dispose()
   at ProppFrexx.ProppFrexx_ONAIR.F67B(Object  , FormClosingEventArgs  )
   at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at DevExpress.Utils.Taskbar.Core.FilterWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
   at System.Windows.Forms.Form.Close()
   at ProppFrexx.ProppFrexx_ONAIR.X67L(Object  , ItemClickEventArgs  )
   at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link)
   at DevExpress.XtraBars.BarItemLink.OnLinkClick()
   at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
   at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
   at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at dCS.TCo.k6sM(String[]  )


Re: Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 13:11
by radio42
Yes, all these entries are not real errors!
I would need to explain how .Net and modern programming languages do work, to let you understand.
In essence they throw a so called 'exception', if some code can not be executed successfully.
Eg. if a network connection cannot be established an exception is thrown. As you might guess this is not an error, but a normal behavior.
The same is true with the other exception. It happens in a certain situation where it might be expected to happen.
However it is only me who can usefully evaluate this.
As such I can only repeat myself, the debug log is intended only for me!
Unfortunately there are good reasons why I added these First Chance exception entries, but it goes far beyond to explain all this here.
As such I unfortunately cannot exclude those entries just for you. There had been cases where customer insisted on a PF error and I needed to proove that the error was within their network, which I could with these log entries.

Again, the normal way of working is to test things with the debug log disabled and if you believe there is an error then turn it on.
Else you must live with the bigger log files and performance degradation.

Re: Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 16:24
by hdradio
I know how modern programming languages work because I am a programmer too ;)
There are ways you can handle an error.
For example if you try to open a file that does not exist an exception is thrown. Of course you can handle that exception. Another way would be to check first if the file exists and then try to open it.
I don't say that one method is better than the other.
But in our case why to fill the debug log with exceptions (and the full stack of them) if you can only write one line (ex. "streaming server is offline.").

Anyway... let's go back to the topic.
What I keep from your answer is that if someone has debug log enabled, he (might) have performance degradation.

I don't have anything more to add. I 'll turn debug log off , hopping that if something wrong happens, it will happen again after enabling it back. And of course I have to send it to you to find what is wrong.

I open a new topic with the problem I have and I hope you can help me solve it.

Re: Debug log contains System.Net.Sockets.SocketException

Posted: 25 Aug 2016 16:52
by radio42
If you are a programmer yourself you know that you cannot prevent those error in a try-catch block.
The First Change Exceptions are all exceptions which are handled or might be handled within those try-catch blocks!
So they are perfectly handled!!!

For socket exceptions you cannot check, if a network connection is available! Sorry, if you are a programmer you would know that.

I do not start a discussion with you about coding here!

Re: System.Net.Sockets.SocketException

Posted: 25 Aug 2016 19:04
by radio42
Yes this is not a bug but a pure warning/info.
The Debug.log now also contains so called First Chance Exceptions, which might indicate possible issues. In this case this is simply the indication that your target server is not reachable within your network.

Note, that the Debug Logging is NOT designed to be turned on permanently!

Re: System.Net.Sockets.SocketException

Posted: 25 Aug 2016 20:41
by radio42
That's why I said: now it contains....

I assume, that you leave it to me what I include in a debug log to find issues, as the log is to be interpreted by me and not by you :-)
If you find an issue, you can then turn it on to log the issue when it happens again.