private static void MqttTests() { var client = new MqttMessageHandler("tpg-hackathon.westeurope.cloudapp.azure.com");//new MqttMessageHandler("169.254.151.119"); client.MqttMsgPublishReceived += PublishReceived; var gamerId = Guid.NewGuid(); client.Subscribe(Topics.Gamer); var packmanPlayer = new Gamer() { Id = gamerId, }; client.Publish <Gamer>(Topics.Gamer, packmanPlayer); client.Subscribe(Topics.Score); var score = new Score(gamerId, 1337); client.Publish <Score>(Topics.Score, score); }
public void PostCustom(string topic, object obj) { _messageHandler.Publish(topic, obj); }