Ejemplo n.º 1
0
 /// <summary>
 /// 构造函数(默认使用Default编码方式)
 /// </summary>
 /// <param name="port">服务器端监听的端口号</param>
 /// <param name="maxClient">服务器能容纳客户端的最大能力</param>
 public ServerSocket(IPAddress serverIP, ushort port, ushort maxClient, string filePath)
 {
     _serverIP  = serverIP;
     _port      = port;
     _maxClient = maxClient;
     _coder     = new Coder(Coder.EncodingMothord.Default);
     if (!filePath.EndsWith("\\"))
     {
         filePath = filePath + "\\";
     }
     _filePath = filePath;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="port">服务器端监听的端口号</param>
 /// <param name="maxClient">服务器能容纳客户端的最大能力</param>
 /// <param name="encodingMothord">通讯的编码方式</param>
 public ServerSocket(IPAddress serverIP, ushort port, ushort maxClient, Coder coder, string filePath)
 {
     _serverIP  = serverIP;
     _port      = port;
     _maxClient = maxClient;
     _coder     = coder;
     if (!filePath.EndsWith("\\"))
     {
         filePath = filePath + "\\";
     }
     _filePath = filePath;
 }