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); }
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(); }
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>(); }
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()); }
public Agent(IProtocol protocol) { _GhostRequest = new GhostRequest(protocol.GetSerialize()); _Agent = new AgentCore(protocol); _SoulProvider = new SoulProvider(this, this, protocol); }
private void _UpdateProvider(SoulProvider[] providers) { foreach (var provider in providers) { provider.Update(); } }