|
![]() |
![]() |
![]() |
![]() |
Your assignment is for your group to implement either a client or a server (or both, if you're feeling especially ambitious) using the standard Berkeley UNIX socket library or the Windows WINSOCK library. We will present a tutorial on these libraries in class on July 11, but if you already know what you're doing, feel free to start working.
Here's some Q&A generated so far:
A: This is OK, especially if it allows more time to build a nice
user interface for the client, or a nice display from the server when it
is running.
A: A single-threaded server is sufficient for this
assignment, but if you want to do a multi-threaded one, that is ok
too. In real life, there are plenty of single-threaded servers, and
multi-threading is not necessarily the "real" way to do it. In
particular, most DICOM implementations are single-threaded.
A: The answer to this is YES! If you're implementing as part of a team, you need a "useful" user interface, etc. But even if you're implementing by yourself, the following client behavior is not sufficient:
[Client] Please input network command.
[User] BREW NOW C 3 7
[Client] Server reports: 200 OK Starting to brew
[Client] Please input network command.
.
.
.
Your client should *not* assume that the CoffeePot User knows anything about the Network Protocol! Instead, you need some sort of abstraction like this (although the example below is certainly not complete enough):
[Client] What would you like to do next?
(a) check status of CoffeePot
(b) brew more coffee
(c) dispense currently brewed coffee
(d) add additions to my coffee
(e) reset the coffee pot
[User] b
[Client] When would you like to start the brew? (use HH:MM format or
'now' for immediate brew)
[User] now
[Client] Would you like caffeinated (C) or decaffeinated (D) coffee?
[User] C
.
.
.
[Client] Thank you for your input. I am now sending your selections
to the CoffeePot.
.
.
.
[Client] The CoffeePot reports that the brewing process started
successfully.
.
.
.
So, your client is responsible both for guiding the user through the input process AND for parsing the server's responses and making them somewhat intelligible to the user. THIS DOESN'T HAVE TO BE FANCY, but it should be complete.
The difference for TEAMS who are implementing a client is that we want to see a GUI, or at least a very well done ASCII front-end (perhaps using ncurses or something like that) ...
A: This is an important point. The strings passed over the network should be terminated with LINE FEED. This is "\n" in C, C++, Perl, etc. If you are using Windows products to test your code, you should be aware that they probably send CR by default.
![]() |
Department of Computer Science & Engineering University of Washington Box 352350 Seattle, WA 98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to owner-cse590ya] |