www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: libssh2_sftp_write blocks for about 3 minutes

Re: libssh2_sftp_write blocks for about 3 minutes

From: Peter Stuge <peter_at_stuge.se>
Date: Sat, 25 Nov 2017 01:18:00 +0000

Jerome Zimmermann wrote:
> Subsequently, TCP Retransmission packets are sent.
> The used operating systems tries this for three minutes.
> When this time is elapsed the TCP socket connection is closed.
> So, the TCP socket is during this three minutes in the connection state,
> although there is no physical connection.
> I am not an TCP/IP expert, but is there in general a way to
> identify such a situation ?

"in general" doesn't fit so well in that sentence.

Most OSes (even Windows! :) allows the TCP stack to be tuned, but
there is no portable API to do so. You are on your own.

It is worth considering here, that libssh2 does not create the
socket, but you do, before you pass the socket to libssh2.

This means that you have a good opportunity to tune the socket as
desired, before you pass it to libssh2.

But also keep in mind, that if you tune the TCP stack to be too
aggressive, your connection will also be torn down by random
intermittent network issues possibly far outside your control.

libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2017-11-25

the libssh2 team