At the moment the best I can come up with is an If/Else statement in my handleClientRequest function.
i.e.
Code: Select all
if(open door)
{
validate, check permissions, update room variable
}
else if(turns on lights)
{
validate, check permissions, update room variable
}
Although as you can tell, this idea wouldn't work if thousands of people were sending open door and turn on lights requests at the same time. So I need to know how to properly "multithread" this scenario so that everything is efficient, clean and fast.
Thank you everyone for your help so far