azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

System.Net.Sockets.SocketException (10060), timeout due to closed ports

Open OcasoProtal opened this issue 3 years ago • 1 comments

Please be aware that it is not possible in some environments to open the firewall for the ports that AMQP over TCP need (5671, 5672). The closed ports will lead to a timeout and the given error message in the title. So I would suggest that you add ServiceBusClientOptions to use with the ServiceBusClient and set the TransportType for the options to AmqpWebSockets which will use port 443:

So in both source codes the line

// Create the client object that will be used to create sender and receiver objects
client = new ServiceBusClient(connectionString);

will change to the following:

var options = new ServiceBusClientOptions(); // or make that a static like client
options.TransportType = ServiceBusTransportType.AmqpWebSockets;

// Create the client object that will be used to create sender and receiver objects
client = new ServiceBusClient(connectionString, options);

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

OcasoProtal avatar Aug 17 '22 08:08 OcasoProtal

@OcasoProtal Thanks for your feedback. We will review and update as appropriate.

mumurug-MSFT avatar Aug 17 '22 12:08 mumurug-MSFT

@spelluru Can you please review and provide your insights.

MayankBargali-MSFT avatar Aug 18 '22 02:08 MayankBargali-MSFT

@OcasoProtal - Thanks for the feedback. I have updated the article, which will go live in an hour.

#please-close

spelluru avatar Aug 23 '22 21:08 spelluru