CIS 432/532 Introduction
to Computer Networks
Fall 2001
Program
#1 FAQ
- Q: Which languages can
I write this assignment in?
A: C or C++. And it must compile on the department's Solaris machines.
- Q: I haven't programmed in C or C++ much. What books
should I use to learn about these languages?
A: For C, the definitive reference is:
The C Programming Language, Second Edition by Brian W. Kernighan and Dennis
M. Ritchie. Prentice Hall, Inc., 1988. ISBN 0-13-110362-8 (paperback), 0-13-110370-9
(hardback). Web site for this book is at: http://cm.bell-labs.com/cm/cs/cbook/
and you can order it at Amazon.com among
other places.
For C++, I highly recommend:
Practical C++ Programming By Steve Oualline, 1st Edition. O'Reilly, September
1995. ISBN 1-56592-139-9. You can also find this at Amazon.com.
- Q: What changes have you made to the protocol spec
based on feedback from student questions?
A: (1) When the server relays a message to a group of users, it should use
"message nick message",
where nick is the nickname of the person sending
the message and message is the text being sent.
(2) Likewise, a private message being relayed by the server has the form "private
nick message".
(3) The user message should return the IP address and port number. (4) The
users and list messages should end with a blank line. (5) The server should
respond with an error when the user tries to login more than once.
- Q: Any typos in the assignment?
A: I changed a typo in the example so that hamburgler types "leave mcdonalds"
when leaving the group.
- Q: In your example, why does Joe get notified of his nickname change when
your protocol says that clients aren't notified of a nickname change?
A: This is a little tricky. In the *protocol* the client does not receive
any message back from the server except for "success". But in the *user interface*
the client parses the success message and prints out "Joe changes his name
to hamburgler".
- Q: With the list command, should users who are not in a group be listed?
A: No.
- Q: How does the user log in? Is there a "/user" command?
A: There is no "/user" command. The client does the login procedure
automatically for the user, before printing a prompt and accepting any commands.
- Q: How does the client know the user's login name?
A: The client can use the getenv() command to find the value of the USER environment
variable, which is set to the user's login name. You can find out more about
this command by typing 'man getenv()'.
- Q: When a user logs in, the default nick is set to the user's login name.
What if someone else is already using that nickname?
A: When you try to set the default nickname, and someone else is already using
that nick, append a sequence number to the new default nickname to make it
unique. You can use any algorithm you want to pick the sequence number; this
does not need to be standardized.
- Q: When I run your solution client, I get some really strange results. The
parameters for the program are different from the spec.
A: You are using a different chat program that resides on the Solaris systems.
Be sure to type "./chat" to run the program that is in the current
directory, or put "." at the beginning of your path.