Hiblet/NewZopa01 — pull request #14 by Hiblet (2014-03-07 16:03:05+00:00)
Title: Fixed Async handling and Subscription issues;  Fixed price packet issues;

CHANGED: AsyncHttpHandlerPrices.cs
-- Remark:
-- -- Deep changes were made to this class because I had not understood
-- -- how to correctly defer the sending of data. I was trying to store
-- -- the context, and instead I should have stored the AsyncResult.
-- Moved processing of inbound request to BeginProcessRequest()
-- Moved the checking of ServiceOrSubscribe to BeginProcessRequest()
-- Added a locker object to protect against the deferred task being run
-- - concurrently on multiple threads
-- Added a startTimestamp to ctor to allow calculation of lifetime
-- Added Lifetime() function to report elapsed lifespan up to 'now'
-- Added HashCode reporting to logging to trace each object's behaviour
-- Added Instance Dtor to trace disposal of AOPs
-- Added State property accessor to allow data to be sent to AOP for task
-- Changed StartAsyncTask() to be the sending of data or an empty string

CHANGED: Prices.js
-- Tolerates empty string data received
-- Uses jQuery.extend() to merge returned data with existing data
-- Changed the processing of received data to match current format
-- Changed the pulling of the sequence number to use current location
-- Changed catch action on http error to console.error() instead of alert

CHANGED: SubscriptionManager.cs
-- Added running flag
-- Added subscription timeout value
-- Added verbose logging on lock take/release
-- Changed contained values to be AsyncOperationPrices (AOP) objects
-- Added Stop() fn to clean up pending connections on exit
-- Added Timeout() fn to clean up stale http requests
-- Changed subscribe() to use AOPs
-- Changed Collate() to use AOPs
-- Changed Dump() to report positively when nothing is subscribed
-- Changed Publish() to use AOPs and publish data via StartAsyncWork()
-- Removed publishToContext() as this is now the AOP deferred task
-- Changed ServiceOrSubscribe()
-- -- to subscribe AOPs
-- -- to call AOP::StartAsyncWork() to publish data
-- -- to only subscribe new AOPs if running flag is true

CHANGED: web.config
-- Added SubscriptionTimeout variable to alter hang time for connections

CHANGED: Global.ASAX
-- Call SubscriptionManager.Stop() as part of graceful shutdown

CHANGED: MarketManager.cs
-- Added call to SubscriptionManager.Timeout() to purge stale requests.

CHANGED: AppThreads.cs
-- Named the threads for easier debugging

CHANGED: CustomContainers.cs
-- Added GetAllContainedValues() to return all unique values

CHANGED: AppThreads.cs; AppUtility.cs
-- Moved LoadIntVariable to common file AppUtility.cs

CHANGED: Default.aspx
-- Removed redundant link

CHANGED: .gitIgnore
-- Ignore database files

REMOVED: ASPNETDB.MDF; aspnetdb_log.ldf; AsynPricesContext.cs