public void RunOneAsync(IHmeConnection connection) { HmeConnectionWrapper wrapper = connection as HmeConnectionWrapper; if (wrapper != null) { ThreadPool.QueueUserWorkItem(ProcessApplicationCommands, wrapper.HmeConnection); } }
public void HandleEventsAsync(IHmeConnection connection) { HmeConnectionWrapper wrapper = connection as HmeConnectionWrapper; if (wrapper != null) { ApplicationEventsData data = new ApplicationEventsData { DriverGuid = _thisGuid, ConnectionGuid = Guid.NewGuid() }; _connections.Add(data.ConnectionGuid, wrapper.HmeConnection); wrapper.HmeConnection.BeginHandleEvent(ApplicationEventsHandled, data); } }
public IHmeConnection CreateHmeConnection(IHmeApplicationIdentity identity, string baseUri, IHmeStream inputStream, IHmeStream outputStream) { if (identity == null) { throw new ArgumentNullException("identity"); } HmeConnectionWrapper wrapper = new HmeConnectionWrapper(inputStream, outputStream); ((HmeApplicationIdentity)identity).CreateApplication(wrapper.HmeConnection, baseUri); return(wrapper); }