public override bool OnStart() { id = RoleEnvironment.CurrentRoleInstance.Id.Split('_')[2]; // Set the maximum number of concurrent connections ServicePointManager.DefaultConnectionLimit = 12; // For information on handling configuration changes // see the MSDN topic at https://go.microsoft.com/fwlink/?LinkId=166357. bool result = base.OnStart(); if (id == "1") { jobServer.Open(); } else { CreateChannel(); } Trace.TraceInformation("WorkerRole has been started"); return(result); }