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

New Post: Transfer the File minimum 49,152 bytes using SFTP

$
0
0
I don't know why, but i found the default buffer size of the client connection is 16k, and when the upload starts, with files over 16kb, the client waits to the buffer will be free again, but this never occur and the timeout is throwing.

To solve that, I'm setting the buffer size to a minor value and it's works fine:
                AuthenticationMethod am = new PasswordAuthenticationMethod(tbUser.Text, tbPsw.Text);
                ConnectionInfo ci = new ConnectionInfo(tbHost.Text, int.Parse(tbPort.Text), tbUser.Text, new AuthenticationMethod[] { am });                                                

                _sftpClient = new SftpClient(ci);
                _sftpClient.BufferSize = 1024 * 8 - 50;

                _sftpClient.Connect();              
Hope it helps

Viewing all articles
Browse latest Browse all 1729

Latest Images

Trending Articles



Latest Images