I took the time to investigate the problem a bit further.
The problem is here:
partialvoid IsSocketConnected(refbool isConnected) { // isConnected = (!this._isDisconnecting && this._socket != null && this._socket.Connected && this._isAuthenticated && this._messageListenerCompleted != null) && !(this._socket.Poll(10, SelectMode.SelectRead)); isConnected = (!this._isDisconnecting && this._socket != null&& this._socket.Connected && this._isAuthenticated && this._messageListenerCompleted != null) && !(this._socket.Poll(1, SelectMode.SelectRead) && this._socket.Available == 0); }
Found out that:
!(this._socket.Poll(1, SelectMode.SelectRead) && this._socket.Available == 0)
returns a wrong value. Don't know why, but do you really need to check this?
You already checked if socket.Connected ...
Thanks!