Saintz
How to make this Faster?
List<Task> tasks = new List<Task>();
int maxThreads = 200;
for (int m = 0; m < 250; m++)
{
Task task = Task.Run(async () =>
{
try
{
object obj = AMF.SendAMF("MovieStarPlanet.WebService.Bonster.AMFBonsterService.WashBonster", new object[4]
{
new TicketHeader
{
Ticket = TicketGenerator.headerTicket(loginResponse["loginStatus"]["ticket"])
},
Convert.ToInt32(ActorBonsterRelId),
100,
loginResponse["loginStatus"]["actor"]["ActorId"]
},proxy);
if (((dynamic)obj)["level"] != 0)
{
Console.WriteLine("SENT REQUEST LEVEL: " + ((dynamic)obj)["level"]);
}
}
catch
{
AMF.SendAMF("MovieStarPlanet.WebService.Bonster.AMFBonsterService.WashBonster", new object[4]
{
new TicketHeader
{
Ticket = TicketGenerator.headerTicket(loginResponse["loginStatus"]["ticket"])
},
Convert.ToInt32(ActorBonsterRelId),
100,
loginResponse["loginStatus"]["actor"]["ActorId"]
},proxy);
}
});
tasks.Add(task);
}
await Task.WhenAll(tasks);
}
60 replies