Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.

    The user of the client has a lot of information to input.

     fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);
    

    The more the user has to enter, the steeper the initial learning curve to use the program is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them in your code would be a more secure and a more user-friendly option.

 fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);

The more the user has to enter, the steeper the initial learning curve to use the program is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them in your code would be a more secure and a more user-friendly option.

  • You have too many comments.

    You have too many comments.

     close(clntSock); /* Close client socket */
    

    For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

 close(clntSock); /* Close client socket */

For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.

    It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.
 fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);

The more the user has to enter, the steeper the initial learning curve to use the program is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them in your code would be a more secure and a more user-friendly option.

  • You have too many comments.
 close(clntSock); /* Close client socket */

For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.

     fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);
    

    The more the user has to enter, the steeper the initial learning curve to use the program is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them in your code would be a more secure and a more user-friendly option.

  • You have too many comments.

     close(clntSock); /* Close client socket */
    

    For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.

deleted 10 characters in body
Source Link
syb0rg
  • 21.9k
  • 10
  • 113
  • 192

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.
 fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);

The more the user has to enter, the steeper the initial user experience learning curve to use the program is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them as variables in your code would be a more secure and a more user-friendly option.

  • You have too many comments.
 close(clntSock); /* Close client socket */

For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.
 fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);

The more the user has to enter, the steeper the initial user experience learning curve is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them as variables in your code would be a more secure and a more user-friendly option.

  • You have too many comments.
 close(clntSock); /* Close client socket */

For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.
 fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);

The more the user has to enter, the steeper the initial learning curve to use the program is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them in your code would be a more secure and a more user-friendly option.

  • You have too many comments.
 close(clntSock); /* Close client socket */

For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.
Source Link
syb0rg
  • 21.9k
  • 10
  • 113
  • 192

Not much to comment on, this program is pretty straightforward. A few notes:

  • The user of the client has a lot of information to input.
 fprintf(stderr, "Usage: %s <Server IP> <Server Port> <Iterations> <Gap>\n", argv[0]);

The more the user has to enter, the steeper the initial user experience learning curve is. Also, I'm not sure I want the user to control the <Iterations> and the <Gap> anyways. A malicious user might abuse this for a DOS of the server. Eliminating those as required input and setting them as variables in your code would be a more secure and a more user-friendly option.

  • You have too many comments.
 close(clntSock); /* Close client socket */

For that particular example, it is quite obvious what that statement does. There are a lot of other comparable examples in this code.

  • It is more common to return 0; when main() is finished, rather than to exit(0). Both will call the registered atexit handlers and will cause program termination though.
lang-c

AltStyle によって変換されたページ (->オリジナル) /