Using a -T setting, A maximum time allowed for a remote query can be configured.
In this example we call a function that exceeds that timeout and throws a stop error:

Server q -p 5000 -T 2

Client