include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = Server Client Server_OBJC_FILES = Server.m Client_OBJC_FILES = Client.m include $(GNUSTEP_MAKEFILES)/tool.makeAfter you compile the two tools, you have definitely to play with them because it's real fun. Start the server:
./obj/ServerNow open another shell (on another machine on the same network if you are so lucky that you can play on the network), and start the client from there:
./obj/Client Client.mthis should display you the Client.m file, as fetched by the Server program.
On my machine it works so simply, immediately and nicely that it is even difficult to realize that the client has actually opened a network connection to the server, asked for the file, and the server has sent it back through the connection! To get more feeling of what is happening,you might want to modify the FileReader class in the server to display a log each time it sends a file:
@implementation FileReader - (NSString *)getFile: (NSString *)fileName { NSLog (@"A client asked for file %@", fileName); return [NSString stringWithContentsOfFile: fileName]; } @end