How to get the socket to listen for replies from referral connections?