Posted 07 April 2017 - 12:40 PM
Hello, I need help with a block of code which could make a computer listen to two different messages from two different pcs at once.
I wrote a few hundreds lines of code which allow me to randomly generate demand (for example 20x wheat) on one pc (lets call it company pc), on the other i programmed a bank account which can remember how much credits has someone on their acc and third pc which shows what demands are currently available (lets call this the HOME pc). The problem is in the HOME pc where the logic is as follows: pc listens to demands from company pcs (for example food company or tool company). The HOME pc can hold 5 demands at once. If there is a slot available, it sends the demanding company pc message, that there is a slot available. The company pc then sends their demand which is saved in the local file in the HOME pc. From this point on the HOME pc needs to listen to other demands from other company pcs as it now has still 4 slots available AND it has to listen to the original demanding company pc which tells our HOME pc if the demand was satisfied in which case the HOME pc deletes the demand.
So again, tldr, i need at the same time to simultaneously listen to two different messages with two different protocols at the same time.
Thanks folks
I wrote a few hundreds lines of code which allow me to randomly generate demand (for example 20x wheat) on one pc (lets call it company pc), on the other i programmed a bank account which can remember how much credits has someone on their acc and third pc which shows what demands are currently available (lets call this the HOME pc). The problem is in the HOME pc where the logic is as follows: pc listens to demands from company pcs (for example food company or tool company). The HOME pc can hold 5 demands at once. If there is a slot available, it sends the demanding company pc message, that there is a slot available. The company pc then sends their demand which is saved in the local file in the HOME pc. From this point on the HOME pc needs to listen to other demands from other company pcs as it now has still 4 slots available AND it has to listen to the original demanding company pc which tells our HOME pc if the demand was satisfied in which case the HOME pc deletes the demand.
So again, tldr, i need at the same time to simultaneously listen to two different messages with two different protocols at the same time.
Thanks folks