• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Quick Java question

vtqanh

Diamond Member
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
 
When 2 initializes it will have to make contact with 1 and 1 should send some sort of acknowledgement. If 1 doesn't respond than 2 has to assume 1 is not running.

Well, it makes sense when I read it 🙂
 
Originally posted by: Descartes
Check my response in the thread you posted in the appropriate forum.

Yeah, just saw that. Thanks. I still have some questions though
Anyone who can help me please read the post in Software/Programming forum.
Thanks
 
Back
Top