Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Gopher Client Functions

The WinInet API also provides functions that your client applications can use to retrieve information from Gopher servers. The Gopher protocol was developed at the University of Minnesota to provide an ASCII-based system for browsing a series of menus to locate various resources on a network.

The WinInet Gopher functions require the use of a Gopher connection handle that was created with a call to InternetConnect().

To access objects on a Gopher server, a special ASCII string known as a Gopher locator is used. This string is similar to the URL strings used in HTTP requests. You can create a locator string with a call to GopherCreateLocator(). You also can retrieve specific information about a locator string with the GopherGetLocatorType() function.

To find Gopher resources on a server, you can start a query with GopherFindFirstFile() and retrieve individual entries with the InternetFindNext() function, as you saw earlier for FTP connections.

You can request information from the server about a Gopher object with a call to GopherGetAttributes(). To retrieve a file from the server, you can use GopherOpenFile() to open a file handle, which then can be used in calls to InternetReadFile().

Share ThisShare This

Informit Network