Not sure I understand the task correctly, I assume you want to wait for receiving data after establishing the connection for at most 1 second.
There is a DevIo_TimeoutRead and DevIo_Expect function, but both are deprecated, as they block FHEM.
A non-deprecated way to read with a timeout is:
- specify a ReadFn function in the module hash (in the Initialize function). If this function is called, it is guaranteed, that one(!) DevIo_SimpleRead call wont block. If the data received by one DevIo_SimpleRead is not complete, remember it, return from the function, and wait for the next call.
- call DevIo_OpenDev (e.g. in the DefineFn or SetFn), specify the 3rd parameter (initFn), and set up there an InternalTimer for 1 second.
- the function called by the timer can close the connection, or do whatever is appropriate.