Пример #1
0
        public void AddStreamTest()
        {
            string       id           = string.Empty; // TODO: Initialize to an appropriate value
            StreamWriter streamWriter = null;         // TODO: Initialize to an appropriate value
            string       expected     = string.Empty; // TODO: Initialize to an appropriate value
            string       actual;

            actual = SseHelper.AddStream(id, streamWriter);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Пример #2
0
        /// <summary>
        /// Stores the stream
        /// </summary>
        private void OnStreamAvailable(Stream stream, HttpContent headers, TransportContext context)
        {
            StreamWriter streamWriter = new StreamWriter(stream);
            var          id           = headers.Headers.ContentLanguage.FirstOrDefault(l => l.StartsWith("id-"));

            if (id != null)
            {
                id = id.Replace("id-", "");
                string newId;
                //we send an ID as a language
                newId = SseHelper.AddStream(id, streamWriter);
                if (IncommingConnectionIdAssigned != null)
                {
                    IncommingConnectionIdAssigned(newId);
                }
            }
        }