コード例 #1
0
ファイル: User.cs プロジェクト: jiowchern/Regulus.Remote
        public User(IStreamable client, IProtocol protocol, object state)
        {
            State  = state;
            Stream = client;

            _Serialize = protocol.GetSerialize();

            _EnableLock = new object();

            _Peer     = client;
            _Protocol = protocol;



            _Responses = new System.Collections.Concurrent.ConcurrentQueue <ResponsePackage>();
            _Requests  = new System.Collections.Concurrent.ConcurrentQueue <RequestPackage>();
            _Reader    = new PackageReader <RequestPackage>(protocol.GetSerialize());
            _Writer    = new PackageWriter <ResponsePackage>(protocol.GetSerialize());

            _ExternalRequests = new System.Collections.Concurrent.ConcurrentQueue <RequestPackage>();

            _SoulProvider = new SoulProvider(this, this, protocol);

            _Updater = new ThreadUpdater(_AsyncUpdate);
        }
コード例 #2
0
ファイル: Agent.cs プロジェクト: kof1016/DataFlow
        public Agent(IProtocol protocol)
        {
            var protocol1 = protocol;

            _GhostRequest = new GhostRequest(protocol.GetSerialize());
            _AgentCore    = new AgentCore(protocol1);

            _CommandBridge = new CommandBridge(_AgentCore, _GhostRequest);
            _SoulProvider  = new SoulProvider(_CommandBridge.RequestQueue, _CommandBridge.ResponseQueue, protocol1);

            Binder       = _SoulProvider;
            GhostQuerier = this;
            _Launch();
        }
コード例 #3
0
ファイル: Peer.cs プロジェクト: jiowchern/Regulus
        public Peer(Socket client)
        {
            _EnableLock = new object();

            _Socket = client;
            _SoulProvider = new SoulProvider(this, this);
            _Responses = new Regulus.Collection.Queue<ResponsePackage>();
            _Requests = new Regulus.Collection.Queue<RequestPackage>();

            _Enable = true;

            _Reader = new PackageReader<RequestPackage>();
            _Writer = new PackageWriter<ResponsePackage>();
        }
コード例 #4
0
        public Peer(IPeer client, IProtocol protocol)
        {
            _Serialize = protocol.GetSerialize();

            _EnableLock = new object();

            _Peer         = client;
            _Protocol     = protocol;
            _SoulProvider = new SoulProvider(this, this, protocol);
            _Responses    = new System.Collections.Concurrent.ConcurrentQueue <ResponsePackage>();
            _Requests     = new System.Collections.Concurrent.ConcurrentQueue <RequestPackage>();

            _Enable = true;

            _Reader = new PackageReader <RequestPackage>(protocol.GetSerialize());
            _Writer = new PackageWriter <ResponsePackage>(protocol.GetSerialize());
        }
コード例 #5
0
 public Agent(IProtocol protocol)
 {
     _GhostRequest = new GhostRequest(protocol.GetSerialize());
     _Agent        = new AgentCore(protocol);
     _SoulProvider = new SoulProvider(this, this, protocol);
 }
コード例 #6
0
 private void _UpdateProvider(SoulProvider[] providers)
 {
     foreach (var provider in providers)
     {
         provider.Update();
     }
 }