Don't use object property for intermediate values of the wrong type
Rename tval param to something more readable
Ensure port and timeout are set as integers