Esempio n. 1
0
 /// <summary>
 /// 构造函数,使用一个特定的编码器来初始化
 /// </summary>
 /// <param name="_coder">报文编码器</param>
 public TCPClient(Coder coder)
 {
     _coder = coder;
 }
Esempio n. 2
0
 // <summary>
 /// 构造函数(默认使用UTF8编码方式和UTF8MaxClient(100)个客户端的容量)
 /// </summary>
 /// <param name="port">服务器端监听的端口号</param>
 public TCPServer(ushort port, Coder coder)
 {
     _port      = port;
     _maxClient = UnicodeMaxClient;
     _coder     = coder;
 }
Esempio n. 3
0
 /// <summary>
 /// 默认构造函数,使用默认的Unicode编码格式
 /// </summary>
 public TCPClient()
 {
     _coder = new Coder(Coder.EncodingMothord.UTF8);
 }
Esempio n. 4
0
 /// <summary>
 /// 构造函数(默认使用UTF8编码方式)
 /// </summary>
 /// <param name="port">服务器端监听的端口号</param>
 /// <param name="maxClient">服务器能容纳客户端的最大能力</param>
 public TCPServer(ushort port, ushort maxClient)
 {
     _port      = port;
     _maxClient = maxClient;
     _coder     = new Coder(Coder.EncodingMothord.UTF8);
 }