public static void SetRpcUser(RpcUser rpcUser) { if (RpcUser != null) { RpcUser.Logout(); } RpcUser = rpcUser; }
public static void SetRpcUser(RpcUser rpcUser, bool isOuterNet) { if (RpcUser != null) { RpcUser.Logout(); } RpcUser = rpcUser; IsOuterNet = isOuterNet; }
public static void Login(RpcUser rpcUser) { if (RpcUser != null) { RpcUser.Logout(); } RpcUser = rpcUser; LoginedOn = DateTime.Now; }
public static TResponse SignPost <TResponse>( string host, int port, string controller, string action, ISignableData data, int?timeountMilliseconds = null) { return(Post <TResponse>(host, port, controller, action, query: RpcUser.GetSignData(data), data, timeountMilliseconds)); }
/// <summary> /// /// </summary> /// <typeparam name="TResponse"></typeparam> /// <param name="host">用于组装Url</param> /// <param name="port">用于组装Url</param> /// <param name="controller">用于组装Url</param> /// <param name="action">用于组装Url</param> /// <param name="signData">用于组装url查询字符串</param> /// <param name="data">post的数据</param> /// <param name="callback"></param> /// <param name="timeountMilliseconds"></param> public static void SignPostAsync <TResponse>( string host, int port, string controller, string action, ISignableData data, Action <TResponse, Exception> callback, int timeountMilliseconds = 0) { PostAsync(host, port, controller, action, query: RpcUser.GetSignData(data), data, callback, timeountMilliseconds); }
public void Test() { string password = Guid.NewGuid().ToString(); RpcUser rpcUser = new RpcUser("test", password); Assert.AreEqual(password, rpcUser.Password); for (int i = 0; i < 10000; i++) { _ = rpcUser.Password; } rpcUser.Logout(); }
public static void SetRpcUser(RpcUser rpcUser) { RpcUser = rpcUser; }