Working handshaker via TCP with timeout.