CSC 546: Client/Server Fundamentals
Fall 2000

HW3: Socket Programming


For this assignment, you will compile and execute versions of the sockets programs discussed in the lectures.

  1. Copy the file clientWin.c and execute this program using Visual C++ on a Windows machine. Recall that this version of the sockets program uses Winsock to create a datastream connection and exchange messages with a server. In order to execute this program, you will need to create a C++ Console App project and add both this file and the Winsock library Wsock32.lib to that project. On my machine, the library is located in: C:\Program Files\Microsoft Visual Studio\Vc98\Lib\Wsock32.lib. You may need to browse your machine to find the corresponding directory.

    A server process should be running on duck.creighton.edu to accept your connection (port 52050).

  2. Modify the client_udp.c program so that it executes using Visual C++ on a Windows machine. Recall that this version of the program uses datagrams to send and receive simple messages from the server. To make this program work under Windows, you will need to make the appropriate modifications/additions as demonstrated in clientWin.c.

    A server process should be running on duck.creighton.edu to accept your connection (port 52051).

  3. Similarly, modify the clientWeb.c program so that it executes using Visual C++ on a Windows machine. Recall that this version of the program uses a datastream to connect to a Web server, and then downloads a Web page by issuing the appropriate GET command. For example, if you specify www.creighton.edu as the host machine and enter /~davereed/index.html at the prompt, the program should download the HTML text for my home page.