SO_SNDBUF too big
Hi,
I'm trying to make a file transfer server that transfers files very fast.
The problem is that for some reason it takes very long for the server to
notice if the connection to the client is (fysically) down, mean while it
keeps sending those packages until the tcp stacks send buf fills. Sometimes
this might tak as long as 15 minutes. I have set the following:
int MAX_TX_BUFFER = 4096;
f( setsockopt( sockfd, SOL_SOCKET, SO_SNDBUF, &MAX_TX_BUFFER, sizeof( int ))
== -1)
{
perror("setsockopt");
exit(1);
}
Now I know if that if I tune the MAX_TX_BUFFER down the time (or actually
the amount of packet sent) needed to notice that the network connection is
down diminished. However since I'm trying to optimise the transfer speed
and reliability to multiple connections tuning the MAX_TX_BUFFER size down
isn't an option. Has anyone any clues?
I've also tried to set KEEPALIVE on but it seems linux doesn't send
keepalives too often.
============================
problems with windows: reboot,
problems with unix: be root.
============================
|