Looks to me that timeout should be a long instead of an int (always used with casting to long)