![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
Ackerman777
这个作者很懒,什么都没留下…
展开
-
c#异步处理消息
线程阻塞+递归实现这里使用ConcurrentQueue来作为存放消息的容器,MessageQueue实例化时,开启线程来对消息进行处理,当容器为空时,可以使用EventWaitHandle堵塞线程EventWaitHandle使用:Set():解除线程堵塞。WaitOne():阻止当前线程继续运行。 class MessageQueue<T> { private ConcurrentQueue<T> queue=null;//用来存放数据.原创 2020-11-10 20:48:16 · 366 阅读 · 0 评论 -
byte读写工具
using System;using System.Collections;using System.Collections.Generic;using System.Net.Sockets;using System.Text;using UnityEngine;class Bufferbyte{ int startIndex = 0; int readIndex = 0; byte[] buffer; public Bufferbyte(int buffer原创 2020-11-05 15:59:01 · 96 阅读 · 0 评论