Implementation of a Protocol for Server/Client communication
Posted on 2007-09-29
I am trying to program a Server/Client application in which I have to implement a protocol for them to communicate. The server is supposed to load an address book from a file, and then allow the client to add/delete from it. I have the server and client classes and I created a protocol class that recognizes the messages from the client, but I am a little confused on the correct way to do the add/delete to the file. The way that I am structuring it is that the client sends a command to the server, the server then passes this message to a method in the protocol class. The server also loads the file when it starts. So is the correct process then to just return a value from the protocol indicating the type of command for the server to do on the file, and then proceed from there? I don;t think the protocol class should write to the file, but I am a little confused on which class should write to the file. Thank you!