일반적인 Gopher 클라이언트 응용 프로그램의 단계
The following table shows the steps you might perform in a typical gopher client application.
Your goal |
Actions you take |
효과 |
---|---|---|
Begin a gopher session. |
Create a CInternetSession object. |
Initializes WinInet and connects to server. |
Connect to a gopher server. |
Returns a CGopherConnection object. |
|
Find the first resource in the gopher. |
Finds the first file. Returns FALSE if no files are found. |
|
Find the next resource in the gopher. |
Finds the next file. Returns FALSE if the file is not found. |
|
Open the file found by FindFile or FindNextFile for reading. |
Get a gopher locator using CGopherFileFind::GetLocator. Use CGopherConnection::OpenFile. |
Opens the file specified by the locator. OpenFile returns a CGopherFile object. |
Open a file using a gopher locator you supply. |
Create a gopher locator using CGopherConnection::CreateLocator. Use CGopherConnection::OpenFile. |
Opens the file specified by the locator. OpenFile returns a CGopherFile object. |
Read from the file. |
Use CGopherFile. |
Reads the specified number of bytes, using a buffer you supply. |
예외 처리 |
Use the CInternetException class. |
Handles all common Internet exception types. |
End the gopher session. |
Dispose of the CInternetSession object. |
Automatically cleans up open file handles and connections. |