简体   繁体   English

Signalr connection.start.done不触发

[英]Signalr connection.start.done not firing

In my javascript code I call .start and stop a couple of times because I have to change the user's identity after the first connection if they exist on my server. 在我的javascript代码中,我调用.start和stop几次,因为如果我的服务器上存在用户,则我必须在首次连接后更改用户的身份。 The first time I call it, the server fires the expected code. 我第一次调用它时,服务器将激发预期的代码。

The second time it never enters the .done or .fail function of the .start call in IE and Edge, but only on our live test server. 第二次它从未在IE和Edge中进入.start调用的.done或.fail函数,而仅在我们的实时测试服务器上。 On my local IIS express it works as intended. 在我的本地IIS Express上,它可以按预期工作。

For reference, on the live test server we are using cross domain for the signalr server, but it works as intended on firefox and chrome. 作为参考,在实时测试服务器上,我们将跨域用于信号发送器服务器,但是它可以在Firefox和chrome上正常使用。

EDIT: It appears only to be after authentication. 编辑:它似乎仅在身份验证之后。 So if I start the connection without leaving page, I can chat using the client. 因此,如果我在不离开页面的情况下开始连接,则可以使用客户端聊天。 But its not until I'm no longer authenticated that I can get it to work correctly again after leaving the page or refreshing. 但是直到我不再通过身份验证后,我才能在离开页面或刷新后使其再次正常工作。

Any thoughts? 有什么想法吗?

This is resolved. 解决了。

For future reference it had to do with a call I was making to the server before I called stop. 为了将来参考,它与我在调用stop之前对服务器的调用有关。 I guess that call never finished and it was causing some errors. 我猜该呼叫从未结束,并导致了一些错误。 I fixed it by adding a .done function to the call I was making before the stop 我通过在停止之前进行的通话中添加.done函数来解决此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM