Im working on a client server application, and what Im gonna do is have the client use a simple case statement.
When 2 is the chosen option, I need to read in a filename (as a string) via the keyboard, which is easily enough done. How would I go about passing that filename to the server, then having the server pass back some kind of response?
Well, depends on what networking technology you're using. Raw sockets? HTTP? RMI? CORBA? If HTTP: forms? raw POST? SOAP? Something else? There are a lot of choices, and every one has its place. Let me know what you're thinking, and we'll move this thread to the appropriate forum for that technology. Or if you have no idea, let's talk about your requirements.
So your RMI server object needs a method something like
and the implementation just has to use the filename (presumably you're dealing with the filenames-having-different-meanings-on-different-machines issue) and return the result. The client then just calls this method to get the result.
I make it sound so easy, that I'm obviously either missing something, or there's some part of this I can help you with. Let me know.
Joined: Oct 26, 2004
So my server has the method processFile(), so how do I pass the filename? Im thinking the processFile() should run like:
client: read in filename and save to variable pass to server wait for server to pass back string
server: listen for client to send filename open file pass back "this file contains...."
I might be asking a really stupid question, but how do I actually pass the file name from the client to the server? [ November 04, 2004: Message edited by: Alan Jackson ]