• 大小: 0.06M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-03-28
  • 语言: 其他
  • 标签: 其他  

资源简介


高效率IOCP的UDP通信服务端,基于IOCP的为管理容器的线程池 提供取出与加入以及线程池大小的操作

资源截图

代码片段和文件信息

/*
    作者:niniBoom
    CSDN:http://blog.csdn.net/nini_boom?viewmode=contents
    163邮箱:13063434858@163.com
-----------------------------------------------------------------
    创建一个大型缓冲区可以划分并分配给SocketAsyncEventArgs 对象,
    用在每个套接字I/O 操作。 这使缓冲区可以轻松地重复使用,可防止
    堆内存碎片化
-----------------------------------------------------------------
    注:这块的代码不多,逻辑简单,但是不建议全部去消化,很多地方需
    要花费不小的学习成本去理解,只记住它的功能即可
-----------------------------------------------------------------
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace UDP_IOCP.UIOCP_Kernel
{
    class BufferManager
    {
        int numBytes;
        byte[] buffer;
        Stack freeIndexPool;
        int currentIndex;
        int bufferSize;
        

        
        /// 
        /// 缓存管理,创建缓存块
        /// 

        /// 缓存的总大小
        /// 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      14336  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\bin\Debug\TestICOPUDP.exe

     文件      42496  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\bin\Debug\TestICOPUDP.pdb

     文件      11600  2018-09-19 09:01  TestICOPUDP\TestICOPUDP\bin\Debug\TestICOPUDP.vshost.exe

     文件        490  2018-04-12 07:35  TestICOPUDP\TestICOPUDP\bin\Debug\TestICOPUDP.vshost.exe.manifest

     文件       3405  2018-04-24 20:58  TestICOPUDP\TestICOPUDP\BufferManager.cs

     文件       2553  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\Form1.cs

     文件       4249  2018-04-25 17:31  TestICOPUDP\TestICOPUDP\Form1.Designer.cs

     文件       6401  2018-04-25 17:31  TestICOPUDP\TestICOPUDP\Form1.resx

     文件       5420  2018-04-25 15:50  TestICOPUDP\TestICOPUDP\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6347  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        762  2018-09-19 09:01  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.csproj.FileListAbsolute.txt

     文件        975  2018-04-25 17:32  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.csproj.GenerateResource.Cache

     文件       9174  2018-04-25 16:04  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.csprojResolveAssemblyReference.cache

     文件      14336  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.exe

     文件        180  2018-04-25 17:32  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.Form1.resources

     文件      42496  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.pdb

     文件        180  2018-04-24 21:00  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TestICOPUDP.Properties.Resources.resources

     文件        492  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\Program.cs

     文件       1354  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\Properties\AssemblyInfo.cs

     文件       2874  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\Properties\Resources.Designer.cs

     文件       5612  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\Properties\Resources.resx

     文件       1098  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\Properties\Settings.Designer.cs

     文件        249  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\Properties\Settings.settings

     文件       3816  2018-04-24 21:00  TestICOPUDP\TestICOPUDP\TestICOPUDP.csproj

     文件       9525  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\UDP_IOServer.cs

     文件       1555  2018-04-24 20:58  TestICOPUDP\TestICOPUDP\UIOCP_Thread_Pool.cs

     文件        875  2018-04-24 20:57  TestICOPUDP\TestICOPUDP.sln

    ..A..H.     24576  2018-04-28 09:36  TestICOPUDP\TestICOPUDP.suo

     目录          0  2018-04-24 20:57  TestICOPUDP\TestICOPUDP\obj\x86\Debug\TempPE

     目录          0  2018-04-25 17:54  TestICOPUDP\TestICOPUDP\obj\x86\Debug

............此处省略10个文件信息

评论

共有 条评论