Handle waiting for connection