selective repeat: timeout using select