This sounds more like a design issue, if your system blocks while @connection is running, you have few choices but create a separate
thread,
and wait for it (or destroy it on timeout).
So my suggestions would either be.
Check if @connection supports some kind of timeout,
Use an event based system where the triggered event is bound to a
connection and a timeout. The underlying system would either disconnect
the
actual request or mark it as invalid if or when an answer arrives.