meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
courses:ct30a5000:assignment1notes [2011/09/22 14:34]
julaakko [Makefiles]
courses:ct30a5000:assignment1notes [2012/09/27 21:55] (current)
julaakko
Line 1: Line 1:
 Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5000/​etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] -  Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5000/​etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] - 
-Updated: ​ --- //​[[jussi.laakkonen@lut.fi|Jussi Laakkonen]] ​2011/09/22 13:24//+Updated: ​ --- //​[[jussi.laakkonen@lut.fi|Jussi Laakkonen]] ​2012/09/27 20:11// 
 + 
 +====== Comments about assignments ====== 
 + 
 +^ Student ^ Comments ^  
 +| 0312399 | Very thorough readme-file. Nice division of code and reusability has been thought. Lots of comments, in future commenting parts of the code on one line would enhance readability. The message content should always be as characters (not integers of any length) as the assignment1 protocol states → this kind of usage breaks protocol compatibility. Good quit handling in server. Some variables storing user input or other data are not initialized in any way. XML files as news headers are a real overkill here. Remember that int = 32bit integer, short = 16bit integer, in few places these seem to mix up. Terminating NULLs for strings do not seem to be properly handled or set. Using length returned by strlen() for copying is dangerous (overflow). AI_PASSIVE is meant for server only (bind), no need to use it in client. Partial sends are not handled. | 
 +| 0316023 | Good division of code. Packing functions do work – if the endianess of the operating system is checked first – it is recommended to use htons()/​ntohs()/​etc for changing the order of the bytes for integers. Partial data is not received or sent, nor properly checked. No date string is sent. Protocol not fully followed, there is no quit message, no calculation of average delay, additional messages? Empty lines sent sometimes as news items. No client register checks – even for correct packet types. No user input in client. Lots of errors with valgrind. | 
 +| 0342246 | Implicit declaration warnings, check the header usage. Ok division of code. Protocol not implemented. Partial data is not received or sent, nor properly checked. No user input. Lots of stuff missing. | 
 +| 0342327 | Invalid binary name. Ok division of code but use more indentation as it makes code more readable. Consider using fgets() for reading user input as it is more safe. The length variable in protocol messages is not properly utilized – check the payload length! Partial data is not received or sent, nor properly checked. Lengths in the sent packets seem to be calculated wrong, use strlen() to check charstring length instead of sizeof() and use these for the data that is actually sent. Remember to initialize variables before use and also remember to use/check terminating NULLs in charstrings. A rather interesting structure in server; a change with select() usage for checking both listening socket and the client socket would make it more extensible (and check returnvalue). News header is static. Cannot serve clients in row if client is disonnected prematurely;​ disconnection detection is not implemented. Can produce a “Floating point exception (core dumped)” if client is quit before receiving a single message. Client leaks memory. | 
 +| 0358454 | Invalid binary name. Good division of code. Partial data is not received or sent, nor properly checked. A rather interesting structure in server; a change with select() usage for checking both listening socket and the client socket would make it more extensible (and check returnvalue). Remember to use/check terminating NULLs in charstrings. The length variable in protocol messages is not properly utilized – check the payload length! Server can serve clients in a row – good. Client leaks memory. | 
 +| 0358674 | does not compile | 
 +| 0377037 | Good division of code. A good way to buffer incoming data per client basis. On first attempt client reports invalid message and shuts down, second try makes the server printout invalid argument, after server is shut down client crashes. Leaks memory. Server cannot deliver anything to client and vice versa? Why does the server print to stdout every millisecond?​ Partial data  receiving and sending would work when looking the code but does not seem to be working. | 
 +| 0378227 | LOTS of compile warnings which might implicate poor functionality. Invalid binary name. Does not follow given input parameter format and gives wrong instructions for parameter usage? Protocol packet format is not followed, check the assignment specification. Why htons() is used with each character of a charstring in protocol packets? Partial data send / receive not handled. Packet length not utilized. Code is a real mess, hard to understand what is happening. Time is hardcoded? No news header implementation. Time sent only once? Valgrind errors. No avg. delay calculations. Client does not handle server disconnection. | 
 +| 0404450 | Good division of code. Remember to add name & student number to files, incl. readme. Compile warnings. Partial send and receive handled nicely and terminating NULLs dealt with – good. Quitting handled well in server. Consider using fgets() for user input. Valgrind errors on server. Client crashes when quitting (segfault). | 
 +| 0404463 | Good division of code, a const length warning in compilation. Add more comments to code. Protocol packets formed in odd way, 16bit stored in 32bit from which 2 bytes are copied, remember the ordering of bytes in big and little endian; safer way to use exact sized int variables. Client does not do a thing and neither does the server. Protocol not implemented,​ nothing sent between client and server. | 
 +| 0404476 | Good division of code. Nothing really implemented,​ client sends something not described in the protocol. Invalid binary name. Client leaks memory. | 
 +| 0404489 | Good division of code. Partial sends handled but partial receiving is not dealt with. Multiuser support lacks some checks, third client does not get anything (not a negative in this first as it was not a requirement). Good implementation. | 
 +| 0404531 | Good division of code. write() for sockets does work but consider using send() as you can pass TCP flags with it. Partial send or receive of data is not dealt with. Client does not start – segfaults, cannot test. Server leaks memory. | 
 +| 0404544 | Division of code into multiple files would increase readability a bit. Partial sends handled well, put partial receiving is not. Remember that htons()/​ntohs()/​etc. return integers as unsigned. Valgrind errors in both. Server “freaks out” when at some point client quits. Clients drop from server after a while. Server leaks lots of memory. | 
 +| 0404557 | Lots of compile warnings which might implicate poor functionality. Ok code division but consider dividing the large functions into smaller pieces as it makes them easier to debug. Also using parameter names in English would help others who look the code. Sending (and receiving) the packet in small pieces is ok with TCP if you always check that everything is sent. This might result in scenario where client actually receives data in smaller pieces. See the packing approach from the wiki pages. Valgrind errors. Server actually froze the computer completely when run with valgrind. Server reacts to client only after the client has quit and after that “broken pipe” and it shuts down. |
  
 ====== Assignment1:​ Notes ====== ====== Assignment1:​ Notes ======
  
 These pages will contain notes about the first assignment including some corrections and ways how to do things correctly. These pages will contain notes about the first assignment including some corrections and ways how to do things correctly.
 +
 +Most of these are from last year but they still apply as quidelines.
  
 ===== Utilizing code examples and tutorials ===== ===== Utilizing code examples and tutorials =====
  
-It is good if you try to find other examples than mentioned on course pages and state them as your sources. **However just stating your source __does not mean that you can copy the code directly__ from the example** [[generic_instructions_and_requirements|as it is required that the work is your own]].+It is good if you try to find other examples than mentioned on course pages and state them as your sources. **However just stating your source __does not mean that you can copy the code directly__ from the example** [[generic_instructions_and_requirements|as it is required that the work is your own]]. But there aren't really many ways to do simple stuff, like ''​getaddrinfo()''​ usage, so this kind of simple things are usually similar than the example you have been looking. But if the whole code is too similar to examples with minor changes (changing variable names) you'll balancing on the edge of the blade.
  
 ===== Makefiles ===== ===== Makefiles =====
Line 203: Line 224:
 } }
 </​code>​ </​code>​
-