behrooz bozorg chami This's my code. using System; using System.Threading; using System.Threading.Tasks; using MQTTnet.Server; using MQTTnet; using System.Text; using static System.Console; namespace MqttBroker { class Program { static void Main(string[] args) { // Create the options for MQTT Broker var options = new MqttServerOptionsBuilder() //Set endpoint to localhost .WithDefaultEndpoint(); // Create a new mqtt server var server = new MqttFactory().CreateMqttServer(options.Build()); //Add Interceptor for logging incoming messages server.InterceptingPublishAsync + = Server_InterceptingPublishAsync; // Start the server //await server.StartAsync(); server.StartAsync(); // Keep application running until user press a key ReadLine(); Task Server_InterceptingPublishAsync(InterceptingPublishEventArgs arg) { // Convert Payload to string var payload = arg.ApplicationMessage?.Payload = = null ? null : Encoding.UTF8.GetString(arg.ApplicationMessage?.Payload); WriteLine( " TimeStamp: {0} -- Message: ClientId = {1}, Topic = {2}, Payload = {3}, QoS = {4}, Retain-Flag = {5}" , DateTime.Now, arg.ClientId, arg.ApplicationMessage?.Topic, payload, arg.ApplicationMessage?.QualityOfServiceLevel, arg.ApplicationMessage?.Retain); return Task.CompletedTask; } } } If I did comment out "//await server.StartAsync();" and used server.StartAsync(); it's ok. So,let me know solution,and also I am waiting for MQTT broker with username/password authenticated from clients request.