New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support closing/stopping a connection from the server side #2101
Comments
It would be nice for the client to be able to subscribe to the reconnect as an event. In that case the answer to the open questions could just be 'let the client figure it out'. Would you agree? I'm very much looking forward to this feature, as it would probably solve an issue I'm having, as described on Stack Overflow. |
Moving this to post 2.0.0 beta as it will cause too much churn. |
It's really a good idea! I need this functionality. To your question, I think you need even so have separate functions for this. But on the other hand, we can not know how to implement client (client for android or ios) but disable this client no longer needed we need. In this mostly seems to me - it's close connections of the server. |
Is there any indication as to when this functionality will be integrated in to SignalR? |
Nope, we have a large backlog and this currently isn't on that list. |
We'll move this to the new repo as a candidate for v3 or beyond. |
With you guys working on SignalR again and released 2.2.1 recently would this be considered to be looked at before V3 .NET Core version? As was hoping if a certain event happened for a specific user. Such as log out then I could force the connection to terminate/close from the server for that user/connection or would there be an alternative approach to this @DamianEdwards or @davidfowl ? |
We are still waiting for this functionality. @DamianEdwards @davidfowl |
We don't have any plans to add this functionality to ASP.NET SignalR at the moment. Could you provide more information about your scenario so we can get an idea of what you'd need here? You originally mentioned it in 2013 so I'm curious what problems you've encountered in the mean time that this would solve. That will help us decide if and how to take such a change. |
I usually use WebSocket as a communication channel between a server and a mobile application, now it's Xamarin. SignalR already supports scaling and it suits me. So I want to use it as a solution for communication between clients and servers. Usually these are games. |
`
` |
@Grart It's sample? because in 2.3 version don't have _clientHub.Abort(); method |
It looks like @Grart 's sample is using ASP.NET Core SignalR, not ASP.NET SignalR |
Any news on this functionality ? I think there is still no method to stop connection from the server side. |
We don't plan to add this functionality in ASP.NET SignalR. It is possible to stop the connection from the server side in ASP.NET Core SignalR. |
@anurse Thanks for your reply, while waiting the reply i saw this on stack overflow |
Yep, that's a workaround available to you. Glad you found a solution! |
How do you do that in ASP.Net Core? I dont find any function in my Edit: Sorry, I am dumb. |
@anurse is there a way to stop connection from server side outside of a Hub? |
When you get a new connection, store it in something and that will let you use it from outside the hub. |
@davidfowl Thanks! |
@davidfowl |
You have access to the connections on your server. If you need to disconnect a connection from any arbitrary server then it gets a bit more difficult. You need to use something like redis, publish a message to the node with the right connection. |
when you say save the connection to use it later do you mean the HubCallerContext? because that is what I need to call Abort() on |
That's correct. |
Add API to the server to allow stopping a connection programatically so that applications can forcibly end a connection based on custom logic.
API should support idea of a terminal close where the client should not try auto-reconnecting when it receives the stop command, as well as a close with reconnect delay, where client will wait for the amount of time passed before attempting to reconnect.
Open questions:
The text was updated successfully, but these errors were encountered: