Does that mean it will try and connect and if it fails to connect in 5 seconds it will timeout and fail to login or does it mean that if no data is sent for longer then 5 seconds it will close the connection ?
So does this mean if I make connection to the device and it fails to connect it will timeout after the time I set or, if I send a command and it takes longer then the timeout time to get through it will then disconnect ?
This value only affects the connection process. There could be all kinds of connection errors. In some cases the connection will fail immediately. However there are other cases when the connection can be very slow (or even never end). The purpose of the timeout is to prevent very slow connections. Once connected this value has no effect.