public ServerHost(Transport tsp, string endpoint, string subscription, TarballStreamWriter tarball, string basePath, int chunkSize, int hwm, int pgmRate, bool testMode) { if (String.IsNullOrEmpty(endpoint)) throw new ArgumentNullException("endpoint"); if (String.IsNullOrEmpty(subscription)) throw new ArgumentNullException("subscription"); if (tarball == null) throw new ArgumentNullException("tarball"); if (String.IsNullOrEmpty(basePath)) throw new ArgumentNullException("basePath"); this.tsp = tsp; this.endpoint = endpoint; this.subscription = subscription; this.tarball = tarball; this.basePath = basePath; this.chunkSize = chunkSize; this.pgmRate = pgmRate; this.testMode = testMode; this.lastChunkSize = (int)(tarball.Length % chunkSize); this.numChunks = (int)(tarball.Length / chunkSize) + ((lastChunkSize > 0) ? 1 : 0); this.numBitArrayBytes = ((numChunks + 7) & ~7) >> 3; //this.currentNAKs = new BitArray(numBitArrayBytes * 8, false); if (this.numChunks == 0) throw new System.Exception(); this.port = 12198; this.device = endpoint; int idx = endpoint.LastIndexOf(':'); if (idx >= 0) { device = endpoint.Substring(0, idx); UInt32.TryParse(endpoint.Substring(idx + 1), out port); } this.hwm = hwm; }
public ServerHost(Transport tsp, string endpoint, string subscription, TarballStreamWriter tarball, string basePath, int chunkSize, int hwm, int pgmRate, bool testMode) { if (String.IsNullOrEmpty(endpoint)) { throw new ArgumentNullException("endpoint"); } if (String.IsNullOrEmpty(subscription)) { throw new ArgumentNullException("subscription"); } if (tarball == null) { throw new ArgumentNullException("tarball"); } if (String.IsNullOrEmpty(basePath)) { throw new ArgumentNullException("basePath"); } this.tsp = tsp; this.endpoint = endpoint; this.subscription = subscription; this.tarball = tarball; this.basePath = basePath; this.chunkSize = chunkSize; this.pgmRate = pgmRate; this.testMode = testMode; this.lastChunkSize = (int)(tarball.Length % chunkSize); this.numChunks = (int)(tarball.Length / chunkSize) + ((lastChunkSize > 0) ? 1 : 0); this.numBitArrayBytes = ((numChunks + 7) & ~7) >> 3; //this.currentNAKs = new BitArray(numBitArrayBytes * 8, false); if (this.numChunks == 0) { throw new System.Exception(); } this.port = 12198; this.device = endpoint; int idx = endpoint.LastIndexOf(':'); if (idx >= 0) { device = endpoint.Substring(0, idx); UInt32.TryParse(endpoint.Substring(idx + 1), out port); } this.hwm = hwm; }