资源简介
包含完整的C#源程序、示例、可直接引用的dll以及性能测试项目。可直接调用用于网络开发。
代码片段和文件信息
using System;
using System.Diagnostics;
using CommonLib;
using Hik.Communication.Scs.Client;
using Hik.Communication.Scs.Communication.EndPoints.Tcp;
using Hik.Communication.Scs.Communication.Messages;
namespace ClientApp
{
class DuplexClientCustomProtocol
{
private static int _messageCount;
private static Stopwatch _stopwatch;
public static void Run()
{
Console.WriteLine(“Press enter to connect to server and send “ + Consts.MessageCount + “ messages.“);
Console.ReadLine();
using (var client = ScsClientFactory.CreateClient(new ScsTcpEndPoint(“127.0.0.1“ 10033)))
{
client.WireProtocol = new MyWireProtocol(); //Set custom wire protocol!
client.MessageReceived += client_MessageReceived;
client.Connect();
for (var i = 0; i < Consts.MessageCount; i++)
{
client.SendMessage(new ScsTextMessage(“Hello from client!“));
}
Console.WriteLine(“Press enter to disconnect from server“);
Console.ReadLine();
}
}
static void client_MessageReceived(object sender MessageEventArgs e)
{
++_messageCount;
if (_messageCount == 1)
{
_stopwatch = Stopwatch.StartNew();
}
else if (_messageCount == Consts.MessageCount)
{
_stopwatch.Stop();
Console.WriteLine(Consts.MessageCount + “ message is received in “ + _stopwatch.Elapsed.TotalMilliseconds.ToString(“0.000“) + “ ms.“);
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-05-29 16:57 TCPServClntCommRMIFrmwrk\
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-Binaries\
文件 49664 2011-06-13 11:38 TCPServClntCommRMIFrmwrk\Scs-Binaries\Scs.dll
文件 137064 2011-06-13 11:38 TCPServClntCommRMIFrmwrk\Scs-Binaries\Scs.xm
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\
目录 0 2011-05-28 23:45 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\bin\
文件 3240 2011-05-28 19:59 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\ClientApp.csproj
文件 1750 2011-05-28 19:34 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\DuplexClientCustomProtocol.cs
文件 1387 2011-05-28 19:59 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\DuplexClientCustomProtocolSynchronized.cs
文件 1662 2011-05-28 19:39 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\DuplexClientDefaultProtocol.cs
文件 1327 2011-05-28 19:52 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\DuplexClientDefaultProtocolSynchronized.cs
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Debug\
文件 3264 2011-05-28 19:15 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Debug\ClientApp.csproj.FileListAbsolute.txt
文件 5632 2011-05-28 19:15 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Debug\ClientApp.exe
文件 11776 2011-05-28 19:15 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Debug\ClientApp.pdb
文件 6173 2011-05-28 19:15 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
目录 0 2011-01-03 22:22 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Debug\TempPE\
目录 0 2011-05-29 16:47 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\
文件 3318 2011-05-28 23:39 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\ClientApp.csproj.FileListAbsolute.txt
文件 8192 2011-05-28 23:42 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\ClientApp.exe
文件 32256 2011-05-28 23:42 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\ClientApp.pdb
文件 6152 2011-05-28 23:42 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\DesignTimeResolveAssemblyReferencesInput.cache
文件 10668 2011-05-28 23:39 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\ResolveAssemblyReference.cache
目录 0 2011-05-25 17:13 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\obj\x86\Release\TempPE\
文件 1005 2011-05-28 19:34 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\OneWayClientCustomProtocol.cs
文件 943 2011-05-28 19:36 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\OneWayClientDefaultProtocol.cs
文件 172 2011-05-28 23:41 TCPServClntCommRMIFrmwrk\Scs-PerformanceTests\Messaging\ClientApp\Program.cs
............此处省略725个文件信息
相关资源
- C#网络编程TCP通信程序简单设计
- C# Winform客户端实现M2Mqtt连接Apollo MQ
- 各种版本UDP和TCP小程序
- C#编写的网络间谍程序源代码(监视记
- C#网络编程实作教程
- 基于c#的p2p文件传输
- 网络应用编程大作业--《你画我猜》
- 基于C#的FTP服务器、客户端设计
- c# asp.net 三层架构 网络相册 (图片存
- ASP.NET 实现的网络硬盘
- C# 搜索引擎和网络爬虫的实现
- OPC UA服务器/客户端开发工具284826
- winform(c#)集成所有opencv功能demo
- 广工c#网络应用编程-实验报告
- c#操作摄像头(带着usb摄像头、mjpeg
- Essential C# 7.0 6th Edition.pdf
- C#使用ModbusTcp协议与西门子1200PLC通讯
- C# 网络课程管理系统源代码完全能运
- C#实现BP神经网络数字图像识别源码
- C#编写局域网抓包工具源码、网络编程
- C# vs2012编写多线程网络爬虫(爬图)
- NET网络高级编程.pdf
- 网络书店销售系统+毕业论文+答辩pp
- C# MVC程序,定时截取网络摄像头大华
- C#卷积神经网络代码
- OPC UA服务器/客户端开发工具
- c# 实现海康威视网络摄像头断连提示
- 游戏服务器引擎C#源码
- 基于LXI协议的C#网络监控系统开发
- C#Socket网络通信实现多人聊天
评论
共有 条评论