signalr的连接ID是不正确的格式 [英] signalr The connection id is in the incorrect format

查看:1406
本文介绍了signalr的连接ID是不正确的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目从mvc4 C#剃刀引擎打造。
我加了最新signalr的NuGet包1.0.1
我的项目使用形式的认证。
每个客户端登录,从时间去注销,反之亦然我得到的客户端上的错误:

I have a project build from mvc4 c# razor engine. I added latest signalr nuget package 1.0.1 My project uses form authentication. each time the client goes from login to logout and vise versa I get an error on the client :

> "NetworkError: 500 Internal Server Error -
> http://myhost:51090/signalr/abort?transport=serverSentEvents&connectionToken=uIJvYLP3T0GdHaowIlS4uPDA19ukUy7TaW8dcXoPfma4Mr52uoe7PLK9Hh3ip17X_3RbFXx92yEa7nxYVHaCiRAWVE5e05vvpLD0_blb94eUwdkXbmhkRPM2_Z590A64VBF2-eLB_8wCWq-dmkkkbe6EqP6c9YXN3WRF5IyNYkB6Wkom7O1ZoDavQQ0UWvok0"

和在服务器侧

 The connection id is in the incorrect format.

我需要考虑不同的方式与signalr工作(从 https://开头的github .COM / SignalR / SignalR /维基/快速入门,集线器),然后用验证?

推荐答案

看来你是登出(修改用户),而你有一个活跃SignalR连接。

It seems that you are logging out (modifying your user) while you have an active SignalR connection.

为什么发生这种情况的原因是因为在服务器上的中止请求,我们检查,看看是否的ConnectionId与正确的用户相关联。因此注销而连接在你失去你的用户关联和导致错误仍然活跃的结果。

The reason why this is happening is because on the abort request on the server we check to see if the connectionId is associated with the correct user. Therefore logging out while the connection is still active results in you losing your user association and causing an error.

要解决这个问题,停止注销前的SignalR连接。

To fix this, stop the SignalR connection before logging out.

这篇关于signalr的连接ID是不正确的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆