Please see http://go.microsoft.com/fwlink/?LinkId=272764 for more information on using SignalR.
Upgrading from 1.x to 2.0
-------------------------
Please see http://go.microsoft.com/fwlink/?LinkId=320578 for more information on how to
upgrade your SignalR 1.x application to 2.0.
Mapping the Hubs connection
----------------------------------------
SignalR Hubs will not work without a Hub route being configured. To register the default Hubs route, create a class called Startup
with the signature below and call app.MapSignalR() in your application's Configuration method. e.g.:
using Microsoft.AspNet.SignalR;
using Owin;
namespace MyWebApplication
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}
Enabling cross-domain requests
---------------------------------------
To enable CORS requests, Install-Package Microsoft.Owin.Cors and change the startup class to look like the following:
using Microsoft.AspNet.SignalR;
using Microsoft.Owin.Cors;
using Owin;
namespace MyWebApplication
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Map("/signalr", map =>
{
// Setup the cors middleware to run before SignalR.
// By default this will allow all origins. You can
// configure the set of origins and/or http verbs by
// providing a cors options with a different policy.
map.UseCors(CorsOptions.AllowAll);
var hubConfiguration = new HubConfiguration
{
// You can enable JSONP by uncommenting line below.
// JSONP requests are insecure but some older browsers (and some
// versions of IE) require JSONP to work cross domain
// EnableJSONP = true
};
// Run the SignalR pipeline. We're not using MapSignalR
// since this branch is already runs under the "/signalr"
// path.
map.RunSignalR(hubConfiguration);
});
}
}
}
Starting the Web server
--------------------------------
To start the web server, call WebApp.Start<Startup>(endpoint). You should now be able to navigate to endpoint/signalr/hubs in your browser.
using System;
using Microsoft.Owin.Hosting;
namespace MyWebApplication
{
public class Program
{
static void Main(string[] args)
{
// This will *ONLY* bind to localhost, if you want to bind to all addresses
// use http://*:8080 or http://+:8080 to bind to all addresses.
// See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx
// for more information.
using (WebApp.Start<Startup>("http://localhost:8080/"))
{
Console.WriteLine("Server running at http://localhost:8080/");
Console.ReadLine();
}
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
SignalR Winform服务端、客户端实现,附带web端调用Demo
共653个文件
dll:200个
xml:101个
nupkg:51个
4星 · 超过85%的资源 需积分: 41 135 下载量 172 浏览量
2018-06-21
11:21:47
上传
评论 3
收藏 42.19MB ZIP 举报
温馨提示
SignalR Winform服务端、客户端实现,附带web端调用Demo。案例包含了永久连接以及集线器两种实现方式,以及web端调用、窗体程序下调用方式实现
资源推荐
资源详情
资源评论
收起资源包目录
SignalR Winform服务端、客户端实现,附带web端调用Demo (653个子文件)
033349d52c6b433e29a1d8fab730d2146c84d8 5KB
07dee9f384a6f0a82a6a73d2b7a1c2948ff79e 255B
09584e2ca03013123bf0412624cae77b51e9ef 740B
0a49ad1c305bf83fb60b34f754a301b38e8d14 2KB
15055e2860b1dd06e5af0a282fd9dec5472bc8 596B
1de1d79e6e8572253011fb7273d55cd825b642 121B
29faf8f04fc40ee88eb71b98b2671756f88ea2 161B
2d9e8440b9c3ed0fbccac1a3afaa7b3372fde8 135B
330445892b5abcd4d1c7195356e1a68641134f 109B
37d572aadb26cacc76ce0672f5a61237019564 621B
3abc614f21c3a4b4265b1f57174c90be25f139 59B
3f853519a6e1b11995bae84a7d252cb1727679 185B
420cf6e7e86872eb4af17da26a1f3c32ffed42 553B
4327e7f1fb1aea19027c2228120e104aaa56d9 260B
4813706b256b35d6cf77a362774cc373b8d592 2KB
4c083c085cf33303976089d3e04850a94215e3 718B
4efe206bd0e7230ad0ae8396a3c883c8207906 2KB
5635168387c0e910b24427de20f68bb91931e4 457B
5a97b59452cdd3f5d0ac3af2657574b2b38660 89B
6863a79c5b47b76c5db01bd30e303d0b6d969f 158B
6865390db69c71278bac822212623b32c77919 160B
6e68281ddecfe6611fbb2c9f79306e69359cab 23KB
6ea25d8fec0313f8da763e0641be679452c618 62B
7613792efb79bd74e7619c9bb94d38b363ee94 1KB
784dc1d5bcb92ab155f578f3723524a3dd9688 17KB
7f200578fe907b4ad13d49f80b160902f0f21e 320B
828447cc5a49b2819430f073e8c6ca3e87e213 541B
8820680b89b17931ab6ac5f658ebcba0dfecd6 242B
89a5030f2192f2efc2eef1e625b588903b735e 20KB
89ed89e7508d113fa3056155a5893ec2ab9330 780B
8a2bd2d6c56773a3cd15811317bebc011ae63e 156B
8d773d18054960feb2467a97c5541b7c65ecd2 4KB
9125705c4e5cd4d88ecf2d9377f6dc4a238823 14KB
96832ae2b2d1c65433f5595394378688322799 9KB
987d65c22c7885f8f45d72ca255088238df6f5 280B
9b521d04a1b0e33c9a907147bb49dcf3be66cd 116B
a5d8f6ce41bb2fe2196e468046f22e741c175e 320B
a799985c43bc7309d701b2cad129023377dc71 11KB
a9982eda4133db3e31965fc0b504c114d053e3 14KB
a9bc9737e6ab84fed5ca1979b11faac4e139dd 12KB
aa758be2e7711b065030a454c2685cca2b1ccf 38KB
Global.asax 103B
b80c275deea9037cfff5e5be65b7ecfe057c78 119B
c3e4852a5a42e6aadd6284e067b66e14a57bc7 16KB
c4920bb828e8bfb5f7efc8f4c074af9e2784ab 63KB
SignalRTest.csprojResolveAssemblyReference.cache 149KB
SignalRService.csprojResolveAssemblyReference.cache 53KB
SignalRWinFormTest.csprojResolveAssemblyReference.cache 17KB
DesignTimeResolveAssemblyReferencesInput.cache 14KB
DesignTimeResolveAssemblyReferencesInput.cache 8KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
DesignTimeResolveAssemblyReferences.cache 1KB
SignalRWinFormTest.csproj.GenerateResource.cache 1012B
DesignTimeResolveAssemblyReferences.cache 711B
SignalRService.csproj.CoreCompileInputs.cache 42B
SignalRTest.csproj.CoreCompileInputs.cache 42B
SignalRWinFormTest.csproj.CoreCompileInputs.cache 42B
COMMIT_EDITMSG 22B
applicationhost.config 84KB
csi.exe.config 9KB
csi.exe.config 9KB
VBCSCompiler.exe.config 8KB
VBCSCompiler.exe.config 8KB
vbc.exe.config 8KB
csc.exe.config 8KB
vbc.exe.config 8KB
csc.exe.config 8KB
ApplicationInsights.config 6KB
ApplicationInsights.config 6KB
packages.config 4KB
SignalRTest.dll.config 3KB
Web.config 3KB
Web.config 2KB
Web.Release.config 1KB
Web.Debug.config 1KB
packages.config 1KB
config 726B
App.config 542B
SignalRWinFormTest.exe.config 542B
App.config 539B
SignalRService.exe.config 539B
packages.config 235B
SignalRService.csproj.CopyComplete 0B
SignalRTest.csproj.CopyComplete 0B
SignalRWinFormTest.csproj.CopyComplete 0B
Form1.Designer.cs 4KB
Form1.cs 3KB
ChatsHub.cs 3KB
Resources.Designer.cs 3KB
EchoConnection.cs 2KB
ServerHub.cs 2KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
BundleConfig.cs 1KB
Settings.Designer.cs 1KB
Startup.cs 1KB
Program.cs 1020B
HomeController.cs 803B
RouteConfig.cs 603B
共 653 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- yhyhyhy2019-01-30还不错啊!很好,就是项目文件带了$符号要删掉
- yeyubajiao2021-05-12简单用例,实用
- TQ821852018-06-22实用,不错
- gxchenyongyu2023-02-18下载学习下,看看有没有用处。
- farstaryao2023-11-18咋用不了?
zhao-yi
- 粉丝: 5
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功