示例#1
0
 /// <summary>
 /// Initialize the internal TcpClient using hostname and port
 /// </summary>
 /// <param name="host">
 /// string : given to the TcpClient constructor : represents a distant host as DNS or IP
 /// </param>
 /// <param name="port">
 /// int : given to the TcpClient constructor : represents the distant port
 /// </param>
 public NSClient(string host, int port, NSUser user)
 {
     client = new TcpClient(host, port);
     stream = client.GetStream();
     Status stat = initConnection(user.Login, user.Password, user.Data, user.Location);
     if (stat != Status.Success) {
         throw new Exception("Status wasn't Success"); // throw Exception for the value of stat
     }
 }
示例#2
0
 /// <summary>
 /// Initialize the internal TcpClient using a IPEndPoint
 /// </summary>
 /// <param name="endpoint">
 /// IPEndPoint : given to the TcpClient constructor : represents a distant host
 /// </param>
 public NSClient(IPEndPoint endpoint, NSUser user)
 {
     client = new TcpClient(endpoint);
     stream = client.GetStream();
     Status stat = initConnection(user.Login, user.Password, user.Data, user.Location);
     if (stat != Status.Success) {
         // throw Exception for the value of stat
     }
 }