Share.Controller/DeviceSubscribe.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Share.Communication;
using Share.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;


/**************************************************************************
*   
*   =======================================================================
*   运行版本    : 4.0.30319.42000
*   命名空间    : Share.Controller
*   文件名称    : DeviceSubscribe.cs
*   =======================================================================
*   创 建 者    : Besion
*   创建日期    : 2019/9/11 18:06:18 
*   邮箱地址    : 986905389@qq.com
*   个人主站    : /
*   功能描述    : 建设中...
*   使用说明    : 
*  
***************************************************************************/

namespace Share.Controller
{
    public class DeviceSubscribe
    {
        public Dictionary<string, SubscribeInfo> SubscribeEventDictionary = new Dictionary<string, SubscribeInfo>();

        public void Subscribe(HttpRequestEventArgs e)
        {
            HttpResponseEventArgs resok = new HttpResponseEventArgs();
            resok.SID = Xml.ConfigManager.Instance.GetDeviceValueByKey("UDN")[0];
            resok.TIMEOUT = e.TIMEOUT;
            resok.Date = DateTime.Now.ToUniversalTime().ToString("r");
            resok.Content_Length = e.Content_Length;
            resok.Connection = e.Connection;
            resok.Server = "UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11";
            resok.Content_Type = e.Content_Type;
            byte[] headbyte = Encoding.UTF8.GetBytes(resok.ToString());
            e.TcpClient.GetStream().Write(headbyte, 0, headbyte.Length);

            //string serviceType = Xml.ConfigManager.Instance.GetDevice().SelectByValue(e.Uri)[0].Parent.SelectByKey("serviceType")[0].Value;


            string key = e.Uri + "-" + e.CALLBACK;
            SubscribeInfo subInfo = null;
            if (SubscribeEventDictionary.ContainsKey(key))
                subInfo = SubscribeEventDictionary[key];
            else
                subInfo = new SubscribeInfo(e.CALLBACK, e.Uri, e.TIMEOUT.Split('-')[1]);
            SubscribeEventDictionary[key] = subInfo;
        }

        public class SubscribeInfo
        {
            public string CallBack { get; set; }
后面还有 32 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。