예제 #1
0
 /// <summary>
 /// 构造函数,使用一个特定的编码器来初始化
 /// </summary>
 /// <param name="_coder">报文编码器</param>
 public TcpCli(Coder coder)
 {
     _coder = coder;
 }
예제 #2
0
 /// <summary>
 /// 构造函数(默认使用Default编码方式)
 /// </summary>
 /// <param name="port">服务器端监听的端口号</param>
 /// <param name="maxClient">服务器能容纳客户端的最大能力</param>
 public TcpSvr(ushort port, ushort maxClient)
 {
     _port = port;
     _maxClient = maxClient;
     _coder = new Coder(Coder.EncodingMothord.Default);
 }
예제 #3
0
 /// <summary>
 /// 默认构造函数,使用默认的编码格式
 /// </summary>
 public TcpCli()
 {
     _coder = new Coder(Coder.EncodingMothord.Default);
 }
예제 #4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="port">服务器端监听的端口号</param>
 /// <param name="maxClient">服务器能容纳客户端的最大能力</param>
 /// <param name="encodingMothord">通讯的编码方式</param>
 public TcpSvr(ushort port, ushort maxClient, Coder coder)
 {
     _port = port;
     _maxClient = maxClient;
     _coder = coder;
 }