Socket封装,支持多客户端支持大文件传输支持多线程并发,对较大的Socket包进行分块传输

    封装所要达到的效果,是可以像下面这样使用Socket和服务端通信,调用服务端的方法,让你在使用Socket的时候,感觉不到Socket的存在,就像是调用本地方法一样,并且支持ref参数和out参数

DemoService demoService = new DemoService();
DemoService2 demoService2 = new DemoService2();
string result = demoService.Test("测试DemoService", 1);
demoService.Test2("测试DemoService", 1);
string result2 = demoService2.RunTest("测试DemoService2", 2);

一、数据结构:

CmdType:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataStruct
{
    /// <summary>
    /// cmd类型
    /// </summary>
    public enum CmdType
    {
        /// <summary>
        /// 执行方法
        /// </summary>
        RunFunction = 1,
        /// <summary>
        /// 心跳
        /// </summary>
        Heartbeat = 2
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2022-02-11
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-07-18
相关资源
相似解决方案