[To Lecture Notes Index]
San Diego State University -- This page last updated February 12, 1995
- References for this lecture
- Client-Server
- Tasks of UI
- Tasks of UI (continued)
- UI Implementation Details
- UI Implementation Details (continued)
- UI Implementation Details (continued)
- Client Protocol Interface
- Chapter 7 in Comer
- Hardware and OS concerns
- Hardware and OS concerns (continued)
- Platform selection
Comer chapters 6 & 7
General notes for the rest of the course
The networking API was covered in detail in CS-576.
We will now concentrate more on algorithms and program structures.
User Interface (UI)
- The User Interface consists of all interactions of a program with
the users, either directly or indirectly.
Examples:
- command line arguments
- ls -aslF
- input files
- Makefile
- question/response
- chfn
Translation of "humanese" into "computerese"
example:
- we use ftp gatekeeper.dec.com
- which the ftp program translates to ftp 16.1.0.2
Error reporting and recovery
example:
- % make disappear
- make: *** No rule to make target `disappear'. Stop.
Translation of user actions into server requests or interactions.
example:
- % mail andrew@sdsu.edu
- Subject: Hi
- Gosh, you are tall
- ^D
but this gets translated into:
- 220-sdsu.edu Sendmail SDSU-Main ready to party ...
- 220 ESMTP spoken here
- HELO rohan.sdsu.edu
- 250 sdsu.edu Hello turtle@rohan.sdsu.edu ...
- MAIL From:<turtle@rohan.sdsu.edu>
- 250 <turtle@rohan.sdsu.edu>... Sender ok
- RCPT To:<andrew@sdsu.edu>
- 250 <andrew@sdsu.edu>... Recipient ok
- DATA
- 354 Enter mail, end with "." on a line by itself
- .
- 250 WAA26313 Message accepted for delivery
- QUIT
- 221 sdsu.edu closing connection
Some things we need to worry about when implemention a UI and in particular a
UI for a client.
- command line argument parsing
- Domain Name Service
- Service to port number translation
- curses vs. stdio
- GUI
Domain Name Service (DNS)
A client should always allow both hostnames and IP addresses to be specified.
Why?
- There may not always be a name registered
- DNS may be unavailable or too slow
Distinguish between name using isdigit() macro on first character.
- Potential problems? What if a hostname starts with a digit?
Library calls to use:
- gethostbyname()
- gethostbyaddr()
Known IP services
A local database of services is located in /etc/services
- example:
- POP (Post Office Protocol) entry:
pop 110/tcp # Post Office
Library call:
- getservbyname()
Problems with this service?
Two hosts can have different port numbers for the same service.
Solutions:
- One service which maps service names to port numbers
- portmapper used with SunRPC
- Include the port number as part of the request
- http://saturn.sdsu.edu:8080/cs/cs596_3/
There are different levels of complexity
general rule: simple protocol simple protocol interface
Issues:
- Does the server only send data when data is explicitly requested?
- telnet
- Does the client have to remember the state the server is in?
- POP
- Will there ever by a role reversal? (client becomes server and server
becomes client) (Why?)
- UUCP
Read section 7.3:
- before going to bed
- before going to work
- before going to class
- before dinner
The section is titled Hiding details
Issues
Operation System:
- Multi tasking
- Preemptive
- Non-preemptive
- Mac MultiFinder
- MS-Windows
- Multi-threaded
Issues in selecting a Client-Server environment:
Is a machine going to be dedicated to be just a server or client?
How are limited resources allocated to services?
Redundency?
- backup servers
- redundent hardware
10,000 E-mail users on a 286 DOS machine?
Rohan dedicated to be a fortune server?
Obvious answers!
What about 1,00 E-mail users on a Pentium-90 running Windows NT