文件名称:CSHARPSOCKET
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:9.72kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
C#实现多线程网络通讯
整个系统由三个核心线程组成,并由.NET线程池统一管理:
侦听客户端连接请求线程:ListenClientRequest(),循环侦听客户端连接请求。如果有,检测该客户端IP,看是否是同一观测设备,然后建立一个客户端TSession对象,并通过Socket异步调用方法BeginReceive()接收数据包、EndReceive()处理数据包
数据包处理线程:HandleDatagrams(),循环检测数据包队列_datagramQueue,完成数据包解析、判断类型、存储等工作
客户端状态检测线程:CheckClientState(),循环检查客户端会话-C# multi-threaded network communication system is composed of three core thread throughout the composition, by the. NET thread pool unified management: a client connection request listening thread: ListenClientRequest (), loop listening client connection request. If you have, testing the client IP, to see if the same observation equipment, and then create a client-side TSession object, and through Socket asynchronous call methods BeginReceive () to receive data packets, EndReceive () processing of data packet data packet processing threads: HandleDatagrams ( ), cyclic test data packet queue _datagramQueue, the completion of the packet parsing to determine the type, storage, etc. the client state detection thread: CheckClientState (), loop checks the client session
整个系统由三个核心线程组成,并由.NET线程池统一管理:
侦听客户端连接请求线程:ListenClientRequest(),循环侦听客户端连接请求。如果有,检测该客户端IP,看是否是同一观测设备,然后建立一个客户端TSession对象,并通过Socket异步调用方法BeginReceive()接收数据包、EndReceive()处理数据包
数据包处理线程:HandleDatagrams(),循环检测数据包队列_datagramQueue,完成数据包解析、判断类型、存储等工作
客户端状态检测线程:CheckClientState(),循环检查客户端会话-C# multi-threaded network communication system is composed of three core thread throughout the composition, by the. NET thread pool unified management: a client connection request listening thread: ListenClientRequest (), loop listening client connection request. If you have, testing the client IP, to see if the same observation equipment, and then create a client-side TSession object, and through Socket asynchronous call methods BeginReceive () to receive data packets, EndReceive () processing of data packet data packet processing threads: HandleDatagrams ( ), cyclic test data packet queue _datagramQueue, the completion of the packet parsing to determine the type, storage, etc. the client state detection thread: CheckClientState (), loop checks the client session
(系统自动生成,下载前可以参看下载内容)
下载文件列表
CSHARPSOCKET.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.