Today, you will work on Part 2 of Part 2 of Lab 2, but I also want you to demo your Part 1 solution to me and try out your Part 1 solution with other group’s Part 1 solution.
About Part 2 of Lab 2
You are implementing the same talk protocol, but the client and server’s behavior changes. This part requires implementing multi-threaded client and server program. I’ll demo my solution again.
Handy References for Part 2
Look at the Requirements and Tips and Resources section of Lab 2 assignment for some links, and tips for:
-
C programming, C strings, C string library, readline library, pass by pointer, … (also Chapter 2 of Dive into Systems)
-
gdb and valgrind guides (also Chapter 3 of Dive into Systems)
-
debugging tips for pthreads programming
-
socket programming
-
man and man pages (also Appendix 2 of Dive into Systems)
make and Makefiles
It is useful to use make
and to know how to write a Makefile, or at
least understand its syntax.
For example, you may descover that you want to write or modify a Makefile
to use to build your project code in this class.
Appendix 2 of Dive into systems has detailed coverage of make and writing Makefiles, and includes several example Makefiles, including one that is a good generic Makefile for C programs that can be copied and minimally modified for lots of uses.
Let’s briefly examine the Makefile for Lab02 together and talk through some of its syntax.
Set-up for Demo of your Part1 Solution
Start out today by compiling your Part 1 solution (in part1/
subdirectory
), and starting up your server (./cs87_server
).
Then write your Group number and server’s IP on the whiteboard so that other group’s clients can attach to your server.