FINALLY FIGURED IT OUT!
Now i have connection timeout on linux!! YAY! What happens is recv()
returns 0 on disconnect, but no error (unlike on windows or OSX where an
disconnect error is returned). So Just have to check for recv == 0 and
disconnect if it happens!