MQTTnet
MQTTnet copied to clipboard
Question - When to call UseMqtt() for Kestrel
Looking at the ASPNET Core example for Kestrel it has the following code during configuration...
opts.ListenAnyIP(1883, l => l.UseMqtt());
opts.ListenAnyIP(5000); // Default HTTP pipeline
When do I choose to invoke UseMqtt() and when do I not?
I think it is whether or not I'm switching to a TCP connection versus forwarding an HTTP connection, but I want to make sure before I do something stupid and blow up my app.
kestrel by default is http when u UseMqtt it switches the protocol for that port to use tcp based mqtt.
if you are using mqtt in the web (websockets) you dont need it. if you want to communicate with machines you do need it.