I posted this in SW forum, but looks like this forum has ten times the traffic, so...😛
I have to write a distributed system program. Assume that there are three servers. 1, 2, 3. Both 2 and 3 will connect to 1. Let's just say that 1 will listen on port 1, 2 will listen on port 2, and 3 will listen on port 3.
If 1 is online first, then it will listen on port 1 and wait for connection from 2 and 3. If 2 is online and it knows that 1 is listening, it will create a connection with 1. Otherwise, it will start listening on port 2. How do you implement that? I mean, how does 2 know that 1 is listening?
Thanks
I have to write a distributed system program. Assume that there are three servers. 1, 2, 3. Both 2 and 3 will connect to 1. Let's just say that 1 will listen on port 1, 2 will listen on port 2, and 3 will listen on port 3.
If 1 is online first, then it will listen on port 1 and wait for connection from 2 and 3. If 2 is online and it knows that 1 is listening, it will create a connection with 1. Otherwise, it will start listening on port 2. How do you implement that? I mean, how does 2 know that 1 is listening?
Thanks