登录
首页 » C# » MQTT通讯(基于C# MQTTNet开发)

MQTT通讯(基于C# MQTTNet开发)

于 2019-10-08 发布
0 241
下载积分: 1 下载次数: 0

代码说明:

基于C# MQTTNet开发,Visual Studio 2017打开项目,其他版本不保证好用

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • radmin21
    说明:  务器端基于select I/O模型。为防止程序界面阻塞,有一个子线程用于不断接收socket并select其中的处理。客户端只有一个线程函数,不过其利用率很高,可用于远程目录交换,请求文件大小,创建若干线程来下载文件。文件传输有上传和下载,还有对等传输,这个项目中,传输文件具体指下载。(Client server based on select I/O model. Programming interfaces in order to prevent obstruction, there is a sub-thread for receiving socket and select which treatment. There is only one client thread function, but its utilization very high, can be used for remote directory exchange, request the file size, create a number of threads to download the file. File transfer are uploading and downloading, as well as peer-to-peer transmission, this project, the specific means to transfer files to download.)
    2008-10-20 11:08:26下载
    积分:1
  • wolf & sheep
    基于C++编写的,关于狼吃羊的小游戏的一个简单编程。(Based on C++, a simple programming about the game of wolf & sheep.)
    2021-01-07 02:28:53下载
    积分:1
  • TheExam
    局域网考试系统 VC++ 在线考试系统 Access SQL Server VC++在线考试系统可连接Access 或SQL Server(LAN VC++ Online Test System Test System Access SQL Server VC++ online examination system can be connected to Access or SQL Server)
    2011-05-16 10:32:25下载
    积分:1
  • CSMA
    csma protocol and implementation
    2013-06-09 16:39:27下载
    积分:1
  • Tcp
    基于TCP/UDP的简单网络编程 客户端和服务器端的开发代码示例(Based on the simple network programming TCP/UDP client and server-side development code examples)
    2012-10-24 16:59:50下载
    积分:1
  • netkit-telnet-0.17
    telnet server telnet server(telnet server)
    2017-03-31 10:19:20下载
    积分:1
  • c# 扫描IP Http Header
    c# 扫描IP Http Headerusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;using System.IO;namespace HScan{ public partial class Form1 : Form { int _currentThreads = 0; int _maxThreads = 100; Thread main = null; Thread mt = null; List threads = new List(); public Form1() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; } private void btnStart_Click(object sender, EventArgs e) { btnStart.Enabled = false; if (txtStart.Text.Trim() == "") { MessageBox.Show("起始IP不能为空."); return; } if (txtEnd.Text.Trim() == "") { MessageBox.Show("结束IP不能为空."); return; } int ts = Convert.ToInt32(txtThreads.Text); _maxThreads = ts; string startIp = txtStart.Text; string endIp = txtEnd.Text; TParameter tp=new TParameter(); tp.StartIp=startIp; tp.EndIp=endIp; tp.ThreadCount=ts; main = new Thread(new ParameterizedThreadStart(StartMe)); main.Start(tp); } protected void ThreadManage() { Thread c=null; while (true) { System.Object lockThis = new System.Object(); lock (lockThis) { for (int i = 0; i < threads.Count; i ) { if (threads[i] != null && !threads[i].IsAlive) { c = threads[i]; break; } } if (c != null) { threads.Remove(c); } } } } protected void StartMe(object ob) { mt = new Thread(new ThreadStart(ThreadManage)); mt.Start(); TParameter p = ob as TParameter; string curIp = p.StartIp; while (true) { for (int i = 0; i < _maxThreads; i ) { if (curIp != "") { if (_currentThreads >= _maxThreads) break; System.Object lockThis = new System.Object(); lock (lockThis) { _currentThreads ; if (_currentThreads > _maxThreads) _currentThreads = _maxThreads; string tip = curIp; Thread t = new Thread(new ParameterizedThreadStart(Run)); t.Start(tip); threads.Add(t); curIp = IPUtility.getLastIp(curIp, p.EndIp, 1); } } else { break; } } } } protected void Run(object ob) { string ip = ob.ToString(); SocketGetHead h = new SocketGetHead(); string ret = h.GetHtml(ip, 80); if (ret.IndexOf("DVRDVS-Webs") > 0) { ListViewItem item = new ListViewItem(); item.SubItems[0].Text = (listView1.Items.Count 1).ToString(); ListViewItem.ListViewSubItem lvSubItem = new ListViewItem.ListViewSubItem(); lvSubItem.Text = ip; item.SubItems.Add(lvSubItem); lvSubItem = new ListViewItem.ListViewSubItem(); lvSubItem.Text = "DVRDVS-Webs"; item.SubItems.Add(lvSubItem); listView1.Items.Add(item); } System.Object lockThis = new System.Object(); lock(lockThis) { lblCurIp.Text = ip; _currentThreads--; if (_currentThreads < 0) _currentThreads = 0; } } private void tsmCopy_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { string ip = listView1.SelectedItems[0].SubItems[1].Text; Clipboard.SetText(ip); } } private void tsmExport_Click(object sender, EventArgs e) { StreamWriter writer = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory "\export.txt",true); foreach (ListViewItem item in listView1.Items) { string ip=item.SubItems[1].Text; writer.WriteLine(ip); writer.Flush(); } writer.Flush(); writer.Close(); MessageBox.Show("导出成功!"); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { if (mt != null) { mt.Interrupt(); mt.Abort(); } foreach (Thread t in threads) { t.Interrupt(); t.Abort(); } if (main != null) { main.Interrupt(); main.Abort(); } } catch { } Thread.Sleep(5000); } private void btnStop_Click(object sender, EventArgs e) { try { if (mt != null) { mt.Interrupt(); mt.Abort(); } foreach (Thread t in threads) { t.Interrupt(); t.Abort(); } if (main != null) { main.Interrupt(); main.Abort(); } } catch { } btnStart.Enabled = true; } }}
    2014-06-23下载
    积分:1
  • pop3 接收邮件
    pop3 接收邮件,ssl加密也可以用
    2014-06-05下载
    积分:1
  • Resource
    一个包含客户端、服务器的Corba实例,基于ACE和TAO(A CORBA Example Consisted of client and server)
    2010-12-10 15:07:14下载
    积分:1
  • vnc-4.0-winsrc_dll
    vnc 封装成dll的代码,方便各位使用修改(vnc package into the dll code, convenient for you to use modified)
    2012-06-18 10:49:59下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载