Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: SFTP parallel downloads with one connection - Exception (not threadsafe?)

$
0
0

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!


Viewing all articles
Browse latest Browse all 1729

Trending Articles