Subject: how to deal with network disconnection error?
I have logged in the Mini client.But sometime, because of the unsteadiness of network, the Client to IM server connections will be intermitted. In the programe, i let the client detect networke state repeatly like msn,once it is available, connect client to IM server again.But there is a problem, when logging in,the Mini client prompt 'the user is already online'. Also there is a error happen. The error is as follow:
System.IO.Exception:can't write data to transport connection,can't access disposed object
object name:“System.Net.Sockets.Socket”??->System.ObjectDisposeException:
At System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode, AsyncCallback callback, Object state)
At System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
At System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
---end of internal abnormal stack track ---
At System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
At agsXMPP.net.ClientSocket.Send(Byte[] bData)
the IM server we used is openfire. when the network is unavailable, and is available for a while. I examine the IM server, it show i'm online, so when i'm logging in, the problems i described above happen. why does that happen? how to resolve it?
System.IO.Exception:can't write data to transport connection,can't access disposed object
object name:“System.Net.Sockets.Socket”??->System.ObjectDisposeException:
At System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode, AsyncCallback callback, Object state)
At System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
At System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
---end of internal abnormal stack track ---
At System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
At agsXMPP.net.ClientSocket.Send(Byte[] bData)
the IM server we used is openfire. when the network is unavailable, and is available for a while. I examine the IM server, it show i'm online, so when i'm logging in, the problems i described above happen. why does that happen? how to resolve it?