Subject: Exception on loss of network connection
In a scenario where a user looses connection to the chat server we are seeing the following exception being thrown. Once started this exception will continue to be thrown every 10 seconds or so. Even reestablishing the connection does not correct it.
Can anyone tell me what might be going on here or how I can handle this error gracefully?
Also is there any reconnection built in to automatically reconnect to the server when a network connection is reestablished?
Exception Message="Object reference not set to an instance of an object." StackTrace="
at Matrix.Net.ClientSocket.get_Connected()

at Matrix.Net.ClientSocket.Send(Byte[] data)

at Matrix.XmppStream.SendData(String xml)

at Matrix.XmppStream.Send(String xml)

at Matrix.XmppStream.KeepAliveTick(Object sender, EventArgs e)

at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)

at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)"
DateTime="2009-11-13T18:49:58.3491995Z"
ADDITION:
I've tried identifying your unhandled exception in the main Application UnhandledException and then tried calling the XmppClient.Close() method. However that itself causes the same exception:
Object reference not set to an instance of an object.: e.Message='Object reference not set to an instance of an object.' e.StackTrace=' at Matrix.Net.ClientSocket.get_Connected()
at Matrix.Net.ClientSocket.Send(Byte[] data)
at Matrix.XmppStream.SendData(String xml)
at Matrix.XmppStream.Send(String xml)
at Matrix.XmppStream.SendStreamFooter()
at Matrix.XmppStream.Close()
at Matrix.Xmpp.Client.XmppClient.Close()
at LookNow.Pages.ChatManager.Disconnect()
Can anyone tell me what might be going on here or how I can handle this error gracefully?
Also is there any reconnection built in to automatically reconnect to the server when a network connection is reestablished?
Exception Message="Object reference not set to an instance of an object." StackTrace="
at Matrix.Net.ClientSocket.get_Connected()

at Matrix.Net.ClientSocket.Send(Byte[] data)

at Matrix.XmppStream.SendData(String xml)

at Matrix.XmppStream.Send(String xml)

at Matrix.XmppStream.KeepAliveTick(Object sender, EventArgs e)

at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)

at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)"
DateTime="2009-11-13T18:49:58.3491995Z"
ADDITION:
I've tried identifying your unhandled exception in the main Application UnhandledException and then tried calling the XmppClient.Close() method. However that itself causes the same exception:
Object reference not set to an instance of an object.: e.Message='Object reference not set to an instance of an object.' e.StackTrace=' at Matrix.Net.ClientSocket.get_Connected()
at Matrix.Net.ClientSocket.Send(Byte[] data)
at Matrix.XmppStream.SendData(String xml)
at Matrix.XmppStream.Send(String xml)
at Matrix.XmppStream.SendStreamFooter()
at Matrix.XmppStream.Close()
at Matrix.Xmpp.Client.XmppClient.Close()
at LookNow.Pages.ChatManager.Disconnect()
This post was edited on 2009-11-13, 22:13 by dandorey.