I have implemented a websocket server as part of WebRole.cs and so far it works, users can connect to the server using the website's URL and the specified endpoint. Now let's say I have 50,000 users who want to connect to the websocket server, I will require more instances of that web role to handle the load.
My question is, if there are multiple web role instances, does this result in multiple web socket servers as well? i.e. Will users still connect using just a single URL/IP and all be connected to each other (e.g. when broadcasting a message), or will users need to enter a different IP to connect to different websocket servers (one for each instance) and only be connected to users on the same server/instance?
EDIT: Specific problem
So if on connect a user gets added to:
private static List<UserContext> Users = new List<UserContext>();
In WebRole.cs. And I have a broadcast method:
private static void Broadcast(String message)
{
foreach (UserContext uc in Users)
{
uc.Send(message);
Console.WriteLine("Broadcasting to: " + Users.IndexOf(uc));
}
}
Will the message be broadcast to all users on the website, or will each instance have its own list of users and therefore only broadcast to users connected to a particular instance?