- Edited
Szalonytomek21 Please format your code properly using ~~~ tags at the start/end of a snippet.
The error you've got is pretty informative. It states that the signal handler for timeout signal should be a function with 0 arguments while you supplied a function with 1 argument. So try to remove that argument from timeout handling function.