Click here to Skip to main content
15,891,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have several custom web form controls that use SignalR (for format checks, username availability but mostly for the notifications). Up until now, I have taken the shortcut of just creating a unique name connection for each control.

Does this actually create several connections to the server, or do they all just use a single connection.

I expect a high volume of users so cutting down the number of connections per user is critical.

If so then I will spend time retro-fitting the js files to use a single named instance of the connection. If not then I won't spend any extra time.

Thanks in advance ^_^
Andy
Posted

1 solution

Read first: http://www.asp.net/signalr/overview/guide-to-the-api/handling-connection-lifetime-events[^]
---
Yes, but with SignalR 2.0 you can handle multiply hubs on a single connection: http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-server#multiplehubs[^]
However in your list of activities you try to do over such hubs there are some that does not belong and should be done in normal (HTTP) way...For instance, validation (format check and username availability) should be initiated from the client using some HTTP (AJAX?) based communication...save SignalR to server initiated communication, like notifications...
 
Share this answer
 
v3
Comments
Andy Lanng 22-Jul-15 9:59am    
Hi, thanks for your reply.
You can call server methods from the client side using signalr. I figured i'd use it whilst it's there.

My question was not "can I use a single connection" but "does it matter if I have more than 1"?

Thanks again ^_^
Kornfeld Eliyahu Peter 22-Jul-15 10:07am    
Yes - it does matter. More connections is more resources is slower performances...However the same (almost) true for multiple hubs on the same connection, if you use them too much, so you have to find the balance...
One of the options to ease SignalR's work is not to use it when it's not appropriate...HTTP connections are come and go as need and less resource hungry...
Andy Lanng 22-Jul-15 10:16am    
Cool - That answers my questions completely. Thanks for the advice ^_^

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900