• Vladislav Vaintroub's avatar
    MDEV-14113 Use abortive TCP close, in case server closes the connection · 70d6c944
    Vladislav Vaintroub authored
    first, and we do not not care whether client has received all data.
    
    This is a TCP optimization to avoid TIME_WAIT in TCP connection teardown.
    
    This patch would abort connection on timeout, which usually happens when
    client reads a large result set, at slower pace then the server can
    write.
    
    The patch also cleans up socket timeout handling, so that Windows
    is consistent with another platforms (using nonblocking socket IO
     + waiting in poll/select on single socket, rather than setsockopt).
    This makes identifying timeouts easier.
    
    
    Also removed the superficial shutdown() before closesocket() in a few
    places where it was used, because it  was never needed , and
    reportedly breaks SO_LINGER on Windows.
    70d6c944
viosocket.c 35.4 KB