int might not be a good choice for timeout as it can not take negative values and the maximum value is not so large, especially on 16bit platforms.