[ Pobierz całość w formacie PDF ]
.A simple example:You would like to have a look at the menu of your cafeteria.1.Start your Gopher client and connect to the main Gopher server.2.Find an item which could include the menu and select it, for example Facilities.3.The sub-items of Facilities are displayed.4.One of the items may be Today's Menu which is a file residing on the canteen'sGopher server.5.If you select it, your Gopher client automatically establishes a connection to theserver pointed to in the item, retrieves and displays the file.460 TCP/IP Tutorial and Technical OverviewThe path to the file could be very complex and Gopher servers around the worldcould be involved.To implement the above-mentioned hierarchy the Gopher client needs someinformation of the object type in order to display a file or a directory icon forexample.The Gopher type is coded as a single digit at the beginning of each line.Following is a list of known Gopher types included in the RFC:0 - Item is a file.1 - Item is a directory.2 - Item is a CSO (qi) phone-book server.3 - Error.4 - Item is a BinHexed Macintosh file.5 - Item is a DOS binary archive of some sort.6 - Item is a UNIX uuencoded file.7 - Item is an Index-Search server.8 - Item points to a text-based telnet session.9 - Item is a binary file.T - TN3270 connection.s - Sound type.Data stream is a mulaw sound.g - GIF type.M - Item contains MIME data.h - html type.I - Image type.i - "inline" text type.The following paragraphs describe the basic functionality of the Gopher protocol.In essence, the Gopher protocol consists of a client connecting to a server andsending the server a selector (a line of text, which may be empty) via a TCPconnection.The server responds with a block of text terminated with a period on aline by itself, and closes the connection.No state is retained by the server betweentransactions with a client.Let's assume a Gopher server listens to port 70.Theonly configuration information the client software retains is this server's name andport number.(In this example that machine is rawBits.micro.umn.edu and the port70.) In the example below the F character denotes the tab character.Client: {Opens connection to rawBits.micro.umn.edu at port 7 }Server: {Accepts connection but says nothing}Client: {Sends an empty line: Meaning "list what you have"}Server: {Sends a series of lines, each ending with CR LF}About internet GopherFStuff:About usFrawBits.micro.umn.eduF71Around University of MinnesotaFZ,5692,AUMFunderdog.micro.umn.eduF71Microcomputer News & PricesFPrices/Fpserver.bookstore.umn.eduF71Courses, Schedules, CalendarsFFevents.ais.umn.eduF9121Student-Staff DirectoriesFFuinfo.ais.umn.eduF71Departmental PublicationsFStuff:DP:FrawBits.micro.umn.eduF7{.etc.}.{Period on a line by itself}{Server closes connection}The first character on each line describes the Gopher type as shown above.Thesucceeding characters up to the tab build the display string to be shown to the userfor making a selection.The characters following the tab, up to the next tab form aselector string that the client software must send to the server to retrieve theChapter 8.Internet Protocols and Applications 461document (or directory listing).In practice, the selector string is often a path nameor other file selector used by the server to locate the item desired.The next twotab delimited fields denote the domain name of the host that has this document (ordirectory), and the port at which to connect.A CR/LF denotes the end of the item.The client may present the above data stream as follows:About Internet GopherAround the University of Minnesota.Microcomputer News & Prices.Courses, Schedules, Calendars.Student-Staff Directories.Departmental Publications.In this case, directories are displayed with an ellipsis and files are displayed withoutany.However, depending on the platform the client is written for and the author'staste, item types could be denoted by other text tags or by icons.In the example, line 1 describes a document the user will see as About InternetGopher.To retrieve this document, the client software must send the retrievalstring: Stuff:About us to rawBits.micro.umn.edu at port 70.If the client does this,the server will respond with the contents of the document, terminated by a periodon a line by itself.As you can see in this example the user does not know or carethat the items up for selection may reside on many different machines anywhere onthe Internet
[ Pobierz całość w formacie PDF ]