NOTES


 Lab 1 Grade Update: 
	Many of you recieved -10 points on lab 1 p2 for incorrectly detecting
	file corruption. I have realized this was due to an error based on how I
	was testing. I have retested the programs and revised the grades accordingly.

	An extra 10% has been given to all students who submitted their lab atleast
	24 hours early.

	Please let me know if there are still any issues you would like to discuss
	related to the grading of your lab1.

Checking Your Grades:
	Use an ssh client to log onto an sslab machine. For example you can type:

		ssh username@sslab01.cs.purdue.edu
	
	Where username is your purdue id. Next use cd to change to the directory:

		/u/data/u3/park/pub/cs422/fall14/grades/username

	Where username is your purdue id. Be careful to change to exactly this
	directory. Due to access control mechanisms you will only be view files 
	from this directory.

	Within this directory you will see multiple files corresponding to grades
	you receive for various assignments. For example your lab1 grade can be
	found in lab1.rpt. To see your grade you can open the specific file or
	print it to the screen using a tool like cat.

	
Lab 1:
      Problem 1:
         It is safe to assume that all reminder times in the input files are 
	 sorted in ascending order.
      Problem 3:
         Do not use the the connect() function to establish a connection between
	 your client and server applications. Simply create the sockets and use
	 sendto and recvfrom functions for data transmission.

	 Using bind() at the server application is necessarry. However, binding
	 is not necessary in the client application. If a bind() call is not used
	 the OS will pick an ephemeral port number along with an IP configured
	 network device.

Lab 2:
	Problem 1:
	The command line arguments to the server application (myreminder) have 
	been updated to include the port number that the server binds to and 
	listens on. 

Lab 3:
	Problem 3:
	vpntunnel's command line arguments have been updated to not include
	a secret-key parameter. The new command line arguments are:
		
		% vpntunnel vpn-IP vpn-port server-IP server-port-number 

Lab 4:
	Problem 2:
	The mytalk program requires asynchronous terminal I/O processing in the
	cases that handle reading and printing user input to the application. 

	For example of how such processing can be done the following code
	can be examined. Notice that the program is able to simultaneously read 
	from the user and handle printing to the screen. Notice that control
	characters are not printed to the screen and backspace prints the
	input (minus the last character) on a new line. This code will have to
	expanded upon inorder for it to work in your application and complete
	all the requirements.


	/* Example code to put terminal in noncanonical mode to read keyboard
	   input one byte at a time: Alex Lentz's idea.
	   Aim is to avoid using curses or full-fledged raw mode that would
	   allow clean handling of asynchronous terminal input/output.
	*/

	#include 
	#include 

	main()
	{
	char a[100], c;
	int i;
	struct termios term1, term2;

	  // remember original terminal setting
	  tcgetattr(0, &term1);
	  term2 = term1;
	  // set to noncanonical mode and disable automatic echoing, i.e.,
	  // keyboard characters are immediately returned and not echo'ed 
	  // to stdout
	  term2.c_lflag &= ~(ICANON | ECHO); 
	  tcsetattr(0, TCSANOW, &term2);

	  // this code is for illustration purposes and must be adapted to
	  // to fit one's app code
	  i = 0;
	  while(1) {				// user types chat message
		c = getchar();
		a[i] = c;			// store typed characters in a[];
		if ((c == 127) || (c == 8)) {	// if typed character is DEL or BS
		  i = i - 1;			// then emulate backspace and print
		  a[i] = '\0';			// corrected input on a new line
		  fprintf(stdout,"\n%s",a);
		  continue;
		}
		else
		  fputc(c, stdout);		// manual echo to stdout
		i++;
		// your code must add logic to transmit a message if user enters RET
	  }

	  tcsetattr(0, TCSANOW, &term1);	// return terminal to default mode

	}

Lab 5
	Problem 1
	The specification for the client's command line arguments are incomplete. 
	Please write myaudiostream so that is called like:

	% myaudiostream  server-tcp-port payload-size pb-del gamma buf-sz target-buf log-file-c requested-file

	Where all arguments are the same except "requested-file" which is the file that is being requested
	from the server.