• 大小: 32.70M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: Socket  tcp  C#  网络  UDP  

资源简介

这是一个调用sharpsocket类库的例子。这个库用起来很简单,性能稳定快速,支持tcp和udp收发任意数据,我之前项目里用过。这里分享下demo。

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using SharpSocket;
using SharpSocket.Interface;

namespace CoreDll
{
    public class BinaryFormattHelper : IBinaryFormatHelper
    {
        public int DataHeaderLength
        {
            get { return 8; }
        }

        public int ParseDataBodyLength(byte[] head)
        {
            return BitConverter.ToInt32(head 0);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-08-29 14:39  SharpSocket V2.8.3 Trial\
     目录           0  2019-08-29 14:39  SharpSocket V2.8.3 Trial\API帮助文档\
     文件      323595  2019-08-29 14:15  SharpSocket V2.8.3 Trial\API帮助文档\SharpSocket.chm
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\CoreDll\
     文件         843  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\CoreDll\codemap.dat
     文件         304  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\CoreDll\global_history.dat
     文件         211  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\CoreDll\workbench.dat
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryClient\
     文件         851  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryClient\codemap.dat
     文件         312  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryClient\global_history.dat
     文件         219  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryClient\workbench.dat
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryServer\
     文件        3638  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryServer\codemap.dat
     文件        1250  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryServer\global_history.dat
     文件         219  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\Supercharger\TCPBinaryServer\workbench.dat
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\
     文件       80896  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\.suo
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\Server\
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\Server\sqlite3\
     文件           0  2019-04-01 21:53  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\Server\sqlite3\db.lock
     文件        4096  2019-04-01 21:53  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\Server\sqlite3\storage.ide
     文件       32768  2019-08-29 14:17  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\Server\sqlite3\storage.ide-shm
     文件      745752  2019-08-29 14:18  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\.vs\TCP收发二进制数据\v15\Server\sqlite3\storage.ide-wal
     目录           0  2019-08-29 14:47  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\CoreDll\
     文件         442  2019-02-28 22:26  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\CoreDll\BinaryFormatHelper.cs
     文件        2450  2019-08-29 14:19  SharpSocket V2.8.3 Trial\demo示例\TCPBinaryDemo\CoreDll\CoreDll.csproj
............此处省略235个文件信息

评论

共有 条评论