示例#1
0
        private void InitializeInstance()
        {
            Concensus  = new Consensus();
            Blockchain = new Blockchain();
            Miner      = new Miner();
            Network    = new Network();
            Accounts   = new Accounts();
            Mempool    = new Mempool();
            Wallet     = new Wallet();

            Client.Socket.On(Socket.EVENT_CONNECT, () => { Client.Connected = true; });
            Client.Socket.On(Socket.EVENT_DISCONNECT, () => { Client.Connected = false; });
            Client.Socket.On("LifeCheck", (jData) =>
            {
                JObject jObject = (JObject)jData;
                var deserialize = jObject.ToObject <LifeCheckStruct>();
                if (LifeCheck != null)
                {
                    LifeCheck.Invoke(deserialize);
                }
            });
        }
示例#2
0
 protected virtual void OnLifeCheck(BaseSocket <TModel> client, object sender = null)
 =>
 LifeCheck?.Invoke(sender ?? this, client);