When active data connections are configured to be used, currently FtpStream waits for an incoming connection indefinitely, while it may never happen, leading to a program hanging. Would be nice if it was possible to set a timeout.
Changes
The following changes to the application are expected
A data connection acceptance timeout setting and a handling of that setting.
Perhaps a similar one for passive connections: currently there is the connect_timeout function for control channel connection, but data channel in passive mode always uses plain connect.
Implementation
Once a setting is introduced, select or something along those lines can be called with a timeout, only calling accept when there is something to accept. For passive mode, TcpStream::connect_timeout can be used, as for the control channel.
Description
When active data connections are configured to be used, currently FtpStream waits for an incoming connection indefinitely, while it may never happen, leading to a program hanging. Would be nice if it was possible to set a timeout.
Changes
The following changes to the application are expected
connect_timeout
function for control channel connection, but data channel in passive mode always uses plainconnect
.Implementation
Once a setting is introduced,
select
or something along those lines can be called with a timeout, only callingaccept
when there is something to accept. For passive mode,TcpStream::connect_timeout
can be used, as for the control channel.