MQTT在线公共的MQTT服务器

一些测试过可以在国内使用的免费的MQTT服务器的host和ipport

地址TCP
broker-cn.emqx.io1883
mqtt.eclipseprojects.io1883
test.mosquitto.org1883
test.ranye-iot.net1883

测试使用的Json

{"你好":"我是发送的消息哦"}

{"Name":"尼桑","Age":223,"Height":176.0,"Width":130.0,"Sex":false,"_scoreDic":{"数学":"123","英语":"23","语文":"3"},"_dateList":["2022-08-13T00:00:00+08:00","2022-08-13T22:15:57.5702248+08:00"],"child":{"ChildName":"GTR","ChlidAge":"12","strList":["chld1","chld2"]}}

     class TestJsonItem
    {
        public  string Name="尼桑";
        public int Age=223;
        public float Height=176;
        public float Width=130;
        public bool Sex=false;

        public Dictionary<string, string> _scoreDic=new Dictionary<string, string>();
        public List<DateTime> _dateList=new List<DateTime>();
        public TestJsonItemChild child=new TestJsonItemChild();
    }

    public  class TestJsonItemChild
    {
        public string ChildName="GTR";
        public string ChlidAge="12";
        public List<string> strList=new List<string>();
    }
//接收消息
	void client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e) 
	{
        Debug.Log("Received: " + System.Text.Encoding.UTF8.GetString(e.Message)  );
	} 

//发送
			client.Publish(top1, System.Text.Encoding.UTF8.GetBytes("Sending from Unity3D!!!"), MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, true);

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值