Connected discovery function to socket setup.