protected override void OnReceived(byte[] data) { UserToken.Unpacker.Unpack(data, (content) => { OnMessage.Invoke(content.Content); }, null, null); OnActived.Invoke(DateTimeHelper.Now); }
protected override void OnReceived(byte[] data) { OnActived?.Invoke(DateTimeHelper.Now.AddSeconds(30)); if (data != null) { this.UserToken.Coder.Pack(data, null, (content) => { OnMessage?.Invoke(Encoding.UTF8.GetString(content.Content)); }, null); } }
/// <summary> /// 激活按钮的状态。 /// </summary> /// <param name="actived">是否激活按钮。</param> public async Task Active(bool actived = true) { Actived = actived; await OnActived.InvokeAsync(actived); }
public void Request(byte[] cmd) { BeginSend(cmd); OnActived.Invoke(DateTimeHelper.Now); }
public void Request(byte[] cmd) { SendAsync(cmd); OnActived.Invoke(DateTimeHelper.Now); }
public void Send(string cmd) { Send(Encoding.UTF8.GetBytes(cmd)); OnActived?.Invoke(DateTimeHelper.Now.AddSeconds(30)); }
public void Request(byte[] cmd) { TaskHelper.Start(() => OnActived.Invoke(DateTimeHelper.Now)); BeginSend(cmd); }
protected override void OnReceived(byte[] data) { TaskHelper.Start(() => OnActived.Invoke(DateTimeHelper.Now)); queue.Enqueue(data); }
protected override void OnReceived(byte[] data) { OnMessage.Invoke(data); OnActived.Invoke(DateTimeHelper.Now); }