Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Lightbulb Program Design Poll


    I just wanted to start a poll to see what everyone's different tastes are.
    Scenario
    Let's say your coding in a 'non-scripting' language like C/C++. The program requirements state that you must code a Ping procedure to ping hosts on a network. Would you go out of your way and code this function using raw sockets? or would you just simply execute the 'ping' command line tool, and pass it arguments?

    Which approach would you take?
    Last edited by hexonx; 01-17-2006 at 06:55 AM. Reason: typo

  2. #2
    I'm not sure exactly what the program is supposed to do, but I would imagine a shell script would be the easiest way to go.

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    That, of course, depends on the circumstances. To begin with, if the program is supposed to run as a normal user, there's no other choice but to call the ping program as a child process, since its SUID privileges are necessary.

    Even if the program is running as root, there are a multitude of circumstances which can sway the decision one way or another, like the I/O model of the program, its purpose, the flexibility it requires with regards to pinging, consistency with existing code, etc. It's very hard to tell.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •