distributed application

194 views Asked by At

i am trying to make a distributed application and could really use some help in how to create it, what i want to do is this

Computer 1 and computer 2 are connected via a LAN.

Computer 1 takes an order from a customer and sends it to comp2. Computer 2 sends an acknowledgement to Computer 1 when order completed.

its a pretty simple code and i think i could just send text between them instead of sending objects, though i am not sure yet, which would be better. any ideas?

i am not sure what i should use to communicate between the computers, should i use socket which i have a little experience with or something like RMI or REST which i have never used before but dont mind learning if it doesnt take alot of time because have to finish this code soon.

would really appreciate the help thanks

1

There are 1 answers

0
AudioBubble On BEST ANSWER

Not sure why you got 3 down votes, but I will try to help, no code snippet will be provided, because that can be found.

if you use a TCP/IP connection:

the

comp1 takes an order from a customer and sends it to comp2. Comp2 sends an acknowledgement to comp1 when order completed.

it is 1 step: if the sender can write, than the reader "acknowledged". I wouldn't use a back message. Same with the old style RPC.

As I can see this is a UDP requirement, and than comp1 should send a message for comp2 with "acknowledged the "acknowledgement" and the comp2 should send back a "acknowledged of acknowledged the "acknowledgement" it is a loool, I hate UDP for this reason.

To open a TCP connection, one of they should listen ( comp2 in this case) and other one ( comp 1 ) it is just connection and do a message. If he got a write error, than the comp2 couldn't receive, ofc. Even if you use REST, the comp2 should be on server side.

For code search for "TCP/IP client server example".

I Hope it helps!