Welcome to Microsoft Q&A! Thanks for posting the question.
This is the socket exception when the connection is made from the client application to the service bus. Please make sure that you are using the right connection string.
If you are using the right connection string (don't remove Endpoint=sb:// or other details) define on your ServiceBusConnectionString object then you need to verify whether the ports are blocked at your client machine. You can follow this troubleshooting guide.
Endpoint=sb://{yourservicebusnae}.servicebus.windows.net/;SharedAccessKeyName={your access key name(RootManageSharedAccessKey)};SharedAccessKey={your key}
Hope the above helps. Feel free to get back to me if you need any assistance.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.