资源简介

需要先还原相关 nuget包,然后再使用,具体方法是:右键解决方案>>管理nuget包>>打开后 点击还原缺少的包即可

资源截图

代码片段和文件信息

using ServerSentEvent4Net;
using slf4net;
using slf4net.Factories;
using slf4net.Resolvers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.SelfHost;

namespace SelfHostDemo
{
    public class SSEController : ApiController
    {
        private static readonly ServerSentEvent SSE = new ServerSentEvent(10 true 25000); 

        public HttpResponseMessage Get(HttpRequestMessage request)
        {
            return SSE.AddSubscriber(request);
        }

        internal static void Send(string s)
        {
            SSE.Send(s);
        }
    }

    class Program
    {
        static readonly Uri _baseAddress = new Uri(“http://localhost:4222/“);
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-03-14 08:21  ServerSentEvent4Net-master\
     文件        1522  2013-03-14 08:21  ServerSentEvent4Net-master\.gitignore
     目录           0  2013-03-14 08:21  ServerSentEvent4Net-master\.nuget\
     文件         164  2013-03-14 08:21  ServerSentEvent4Net-master\.nuget\NuGet.Config
     文件      650752  2013-03-14 08:21  ServerSentEvent4Net-master\.nuget\NuGet.exe
     文件        7627  2013-03-14 08:21  ServerSentEvent4Net-master\.nuget\NuGet.targets
     文件        1964  2013-03-14 08:21  ServerSentEvent4Net-master\README.md
     目录           0  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\
     文件         182  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\App.config
     文件        2481  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\Program.cs
     目录           0  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\Properties\
     文件        1418  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\Properties\AssemblyInfo.cs
     文件        4550  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\SelfHostDemo.csproj
     文件         659  2013-03-14 08:21  ServerSentEvent4Net-master\SelfHostDemo\packages.config
     文件        2234  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net.sln
     目录           0  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\
     文件         439  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\IMessage.cs
     文件         733  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\IMessageHistory.cs
     文件         467  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\IMessageIdGenerator.cs
     文件        1809  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\IServerSentEvent.cs
     文件        1360  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\MemoryMessageHistory.cs
     文件         183  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\NoAdditionalClientInformation.cs
     目录           0  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\Properties\
     文件        1487  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\Properties\AssemblyInfo.cs
     文件        9175  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\ServerSentEvent.cs
     文件        4963  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\ServerSentEvent4Net.csproj
     文件         734  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\ServerSentEvent4Net.nuspec
     文件        5186  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\ServerSentEventGeneric.cs
     文件         385  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\SimpleIdGenerator.cs
     文件         423  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\SubscriberEventArgs.cs
     文件         760  2013-03-14 08:21  ServerSentEvent4Net-master\ServerSentEvent4Net\packages.config
............此处省略109个文件信息

评论

共有 条评论