Try connecting to kdb straight away, retry 100 times with 50ms delay.