How to use more than one ServerEventClient instances?

I would like to instantiate e.g. 2 ServerEventClients but it seems to be impossible because the second instance will get a timeout exception when calling SubscribeToChannels:

   string baseURI = "myURI";
   var clientsse1 = new ServerEventsClient(baseURI, new string[] { "init1" });
   clientsse1.Connect().Wait();
   clientsse1.Start();
   clientsse1.SubscribeToChannels(new string[] { "channel1" });

   var clientsse2 = new ServerEventsClient(baseURI, new string[] { "init2" });
   clientsse2.Connect().Wait();
   clientsse2.Start();
   clientsse2.SubscribeToChannels(new string[] { "channel2" });

the only way to get the above code running is to use different CNAMEs as baseURI which points on the same IP

Ah ok I solve the problem by inrceasing the ServicePointManager.DefaultConnectionLimit :thumbsup:

1 Like